MySQL / Error_Checking


1:
2:
3:
4:
5:
6:
7:
8:
9:
10:

<?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";
?>

Description

  Check for errors using mysql_errno() and mysql_error()