PHP & MySQL – Handling NULL Example You can use the if…else condition to prepare a query based on the NULL value. The following example takes the tutorial_count from outside and then compares it with the value available in the table. Example Copy and paste the following example as mysql_example.php − <html> <head> <title>Handling NULL</title> […]
PHP & MySQL – Database Info Example There are a few important commands in MySQL which can be executed either at the MySQL prompt or by using any script like PHP to get various important information about the database server. Sr.No. Command & Description 1 SELECT VERSION( ) Server version string 2 SELECT DATABASE( ) […]
PHP & MySQL – Sorting Data Example PHP uses mysqli query() or mysql_query() function to get sorted records from a MySQL table. This function takes two parameters and returns TRUE on success or FALSE on failure. Syntax $mysqli->query($sql,$resultmode) Sr.No. Parameter & Description 1 $sql Required – SQL query to get sorted records from a table. […]