Insert records In this lesson we are going to write a PHP script that inserts a new record in our database through HTML forms. The INSERT INTO statement in sql is used to insert a record in the database. In…
Programming
PHP-MySQL Lesson: Select Database
Select Database After we have establish the connection in MySQL server, we have to select a database. To do that we are going to use the mysql_select_db() function. Syntax: mysql_select_db(databasename,connection) Parameter: databasename – the database name you want to use.…
PHP-MySQL Lesson – Create Table
Creating a Table In this lesson we are going to write a PHP script that will create a table in our MySQL database. To create a table in MySQL, use the command CREATE TABLE tablename. In PHP,mysql_query() function is used to execute…
PHP-MySQL Lesson – Create Database
Creating a Database The CREATE DATABASE statement in sql is used to create a database in MySQL. In PHP,mysql_query() function is used to execute sql query like insert, delete, update, select etc. Here is an example PHP script that creates a…
PHP-MySQL Lesson – Connecting to MySQL database
Connecting to MySQL database In order to access and manage records in a database, we need first to establish a connection to the database. To connect to the MySQL database we are going to use the mysql_connect() function. Here is…
PHP-MySQL Lesson: Introduction
PHP-MySQL Lesson: Introduction PHP and MySQL PHP is an open source scripting language used to create dynamic website. MySQL is also an open source relational database system that uses Structured Query Language (SQL). PHP supports variety of databases, but MySQL…
PHP Tutorial – PHP Forms
In this tutorial we are going to learn how to take data entered by the user in an HTML form and process it into PHP script and display the output. We need two pages here namely the process.php and the…
PHP Tutorial – PHP $_GET and $_POST
PHP $_GET and $_POST The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input. The $_POST Function The built-in $_POST function is used to collect values in a form with method=”post”. Information sent from…
PHP Tutorial – PHP Function
PHP Tutorial – PHP Function In this lesson we are going to learn how to create a function in PHP. A function is a block of codes that performs a particular task which can be executed anywhere in the page…
PHP Tutorial – PHP Arrays
PHP Tutorial – PHP Arrays An array is a special variable that can store multiple values in a single variable. The elements of the array are accessed via an index number, with the first element starting at zero. An array…