PHP

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.

How to Highlight Matched Keyword in Search using PHP

Submitted by nurhodelta_17 on
In this tutorial, you will learn on how to highlight matched search keyword using PHP. For the users to be aware why a certain result match to a searched keyword, we need a functionality that highlights matched word to the keyword. In this tutorial, I'm going to use preg_filter() function in order to achieve that functionality.