Need Programming Assignment Help?

Get Help with Programming Assignment in Java, C/C++, Dot Net, PHP, Database and UML Diagrams

Error Checking MySQL Code in PHP

Error Checking MySQL Code in PHP

Error Checking MySQL Code – This simple PHP Programming code returns the text of the error message from previous MySQL operation.

<?php 
 mysql_connect("localhost", "mysql_user", "mysql_password"); 

 mysql_select_db("nonexistentdb"); 
 echo mysql_errno() . ": " . mysql_error(). "\n"; 

 mysql_select_db("kossu"); 
 mysql_query("SELECT * FROM nonexistenttable"); 
 echo mysql_errno() . ": " . mysql_error() . "\n"; 
?>