PHP Tutorial

How to Validate Select in CodeIgniter

Submitted by nurhodelta_17 on
This tutorial tackles on how to validate select in codeigniter. Often times we use input text to collect data from our users. If you are using codeigniter and added validation which includes a select tag, this tutorial will help you validate the select tag and return the value selected by user if validation fails.

How to Create Two Submit Buttons with Different Action in One Form

Submitted by nurhodelta_17 on
This tutorial tackles on how to create two submit button with different actions in one form. Traditionally, it only takes one submit button in every form. There are instance however that you wanted to have two actions in just one form. In order to achieve this, we are going to use javascript.

How to Pass Optional Paramater to a Function in PHP

Submitted by nurhodelta_17 on
This tutorial tackles on how to pass optional parameter to a function in PHP. When we create a function and set a parameter to pass to this function, the function expects the parameter to be passed and will throw an error if none given. For instance that you wanted to pass an optional parameter to a function, hope you'll find this tutorial helpful.

How to Get the Average of One Column in MySQL Database using PHP

Submitted by nurhodelta_17 on
This tutorial tackles on how to get the average of one column in mysql database using PHP. There are instance that we wanted to get the average of one column for reporting purposes like average sales, expenses etc. Normally, we get the sum of the column then we divide it by number of rows but actually there is a sql function that determines the average of one column.

Login and Register using PDO in PHP

Submitted by nurhodelta_17 on
This tutorial tackles on how to create a simple login and register using PDO extension in PHP. PDO stands for PHP Data Objects and as per official site description, defines a lightweight, consistent interface for accessing databases in PHP. PDO is the most recommended extension nowadays to interact with database because of many features like preventing SQL injections, prepared statements, etc.

SQLite 3 Database Encryption

Submitted by nurhodelta_17 on
This tutorial tackles on how to encrypt data in a sqlite3 database using PHP. SQLite as per site description, is an in-process library that implements a self-contained, serverless, zero-configuration, transactional SQL database engine. The data in this database however are easily access thus, I've created this tutorial as a simple solution.