Using BETWEEN condition BETWEEN condition is used to retrieve records with in the given range. The syntax of BETWEEN condition: SELECT column_name(s) FROM table_name Where column_name BETWEEN value1 AND value2;
MySQL Tutorial – Using the IN function
The IN function can be used to replace the OR condition. It is also used to specify multiple value together with the WHERE clause. The syntax of IN function: SELECT column_name(s) FROM table_name Where column_name IN (value1,value2,etc…);
MySQL Tutorial – Using HAVING clause
Using HAVING clause HAVING clause is somewhat similar to WHERE clause and it is used together with the GROUP BY clause. It was added to SQL to combine with the aggregate functions because the WHERE clause doesn’t allow aggregates. The…
PHP-MySQL Lesson: DELETE statement
DELETE statement In this lesson we are going to write a PHP script that deletes records in MySQL database using the DELETE statement. We can execute any sql query like insert, update, delete, select etc. using the mysql_query() function. In…
PHP-MySQL Lesson: UPDATE statement
UPDATE statement In this lesson we are going to write a PHP script that updates records in MySQL database using the UPDATE statement. Parameter of UPDATE command: UPDATE – Performs an update MySQL query SET – Updates (assigns new value…
PHP-MySQL Lesson: The ORDER BY Clause
The ORDER BY Clause In this lesson we are going to write PHP scripts that select a records in MySQL and sort it using the ORDER BY clause. Using ORDER BY clause we can sort the data in a recordset…
PHP-MySQL Lesson: The Where Clause
The Where Clause In this lesson we are going to write PHP scripts that select a specific records in MySQL using the WHERE clause Using WHERE clause we can specify a selection criteria to select, update,delete required records from a…
PHP-MySQL Lesson: Select Data in Database and Display the record in HTML table
PHP-MySQL Lesson: Select Data in Database and Display the record in HTML table In this lesson we are going to write PHP scripts that select records in MySQL database and display it in HTML table. The SELECT statement in sql…
PHP-MySQL Lesson: Insert records
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…
MySQL Tutorial – Using Column Aliases
Column Aliases To rename a column in database table, use the AS keyword it allows you to alias the name to different value. The syntax of AS keyword: SELECT column_name(s)AS alias_name FROM table_name AS keyword example: SELECT f_name AS Firstname…