Category : PHP

Mysql PHP

How to Connect php with mysql Database

Anuj Kumar
Code for mysql connection with php <?php define('DB_SERVER','localhost'); define('DB_USER','root'); define('DB_PASS' ,''); define('DB_NAME', 'dbname'); $con = mysqli_connect(DB_SERVER,DB_USER,DB_PASS,DB_NAME); // Check connection if (mysqli_connect_errno()) {  echo "Failed to connect
PHP Web Development

How to create pagination in PHP

Anuj Kumar
File structure for this tutorial : config.php (Database configuration file) index.php (Main file)  tbluser.sql (SQL Table structure with dummy data) Demo——————————————————— First create a table
PHP Web Development

How to fetch data in excel or generate excel file in PHP

Anuj Kumar
File structure for this tutorial :   config.php (database connection file)   index.php (For fetching data )   genrate-excel.php (For genrating excel file ) Create
PHP

How to Concatenate two or more string in PHP

Anuj Kumar
We can concatenate two or more string in PHP by concatenation operator(“.”); Example 1 : <?php $string1="Hello"; $string2="World !!"; $string3=$string1.$string2; echo $string3; ?> Output :
PHP Web Development

How to get yesterday and tomorrow date in php

Anuj Kumar
Syntax for getting yesterday using php <?php echo "Yesterday Date : "; echo date("Y-m-d",strtotime("yesterday")); ?> Syntax for getting tomorrow using php <?php echo "Tomorrow date
PHP Web Development

How to Salt & Hash a Password using Sha256

Anuj Kumar
In last tutorial we learned password hashing in php. In this tutorial we will learn How to Salt & Hash a Password with Sha 256 in