PHP MySQL-JOIN Table

PHP MySQL-JOIN Table
PHP MySQL JOIN Table The JOIN in mysql is used to merge two or more tables into the single table. Userlist table ID    Name 1       vikas 2      pankaj 3      rajesh 4      mohit Sallary table sall_id     user_id    sallary 1                 1                2000 2                4                3000 3                3                1000 4 [...]

PHP MySQL-Order By

PHP MySQL-Order By
PHP MySQL Order By The ORDER BY keyword is used to sort the records. By Using ORDER BY we can sort the records accending and decending order. Syntax: SELECT column_name FROM table_name ORDER BY column_name ASC|DESC Example: [PHP] <?php $con=mysqli_connect(“technohp.com”,”user”,”xyz123″,”my_dbname&# [...]

PHP MySQL-Where

PHP MySQL-Where
PHP MySQL Where Clause In the last lesson we did a SELECT query to get all the data from our “user_list” table. If we wanted to select only certain records of our table, then we would use the WHERE condition. Syntax SELECT column_name FROM table_name WHERE column_name operator value Example of MySql where clause [PHP] <?php $co [...]

PHP MySQL-Select

PHP MySQL-Select
PHP MySQL Select Query The SELECT statement is used to select data from a database. Syntax SELECT column_name(s) FROM table_name Example [PHP] <?php $con=mysqli_connect(“technohp.com”,”user”,”xyz123″,”my_dbname”); // Check connection if (mysqli_connect_errno()) { echo “Failed to conne [...]

PHP MySQL-INSERT

PHP MySQL-INSERT
PHP MySQL Insert Query The INSERT INTO Statement is used to insert new records to the database table. Syntax First type: INSERT INTO table_name VALUES (value1, value2, value3,…) Syntax Second type: INSERT INTO table_name (column1, column2, column3,…) VALUES (value1, value2, value3,…) Example: [PHP] <?php $con=mysqli_conne [...]

PHP Mysql-Create Database/Table

PHP Mysql-Create Database/Table
Mysql Create Database The CREATE DATABASE statement is used to create a database in MySQL. The given below example shows how to create the database name my_database. [PHP] <?php // Create connection $connect=mysqli_connect(“technohp.com”,”user123″,”xyz123″); // Check connection if (mysqli_connect_errno() [...]

PHP MySQL-Connect

PHP MySQL-Connect
PHP Connect to the MySQL mysqli_connect function is used to open new connection to the MySql Server. Syntax mysqli_connect(host,username,password,databasename); host is either the host name or IP Address of the server. username is the username of the mysql database password is the passwordof the mysql database. databasename is the database n [...]

PHP mail() Function

PHP mail() Function
PHP mail() Function In the PHP we can send the mail through the mail() function. Syntax mail(to, subject, message, headers, parameters); to parameter is required. Specifies the recipient email ID. Subject parameter is required. Specifies the email’s subject line. message parameter is required. Specifies the actual email body. headers p [...]

PHP Cookies

cookie
What is a Cookie A cookie is often used to identify a user. A cookie is a file that the server embeds on the user computer. With PHP you can create and retrieve cookie values. How to Create a Cookie The setcookie() function us used to set the cookie. Syntax setcookie(name, value, expire, path, domain); Example In the Example we will create th [...]

PHP Sessions

phpsession
A PHP session variable is used to store information about a user. Session variables Stores information about user, and are available to all pages in the website. Starting a PHP Session Before storeing the user information in your PHP session, you must first start up the session at the top of the page. Example to Start Session: [PHP] <?php [...]

PHP Tutorial