Db Connect And Calling A Function

Advertisement

I have database connect script at the beginning of my PHP page which sets the dbconnection. when I run a query in the script it works fine I have decided that rather than use the default error catch like this:

$result=mysql_query($query,$db_connect) or die("There has been an error adding the appointment to the database.".mysql_error());which works fine I would call a function to handle the errors - particularly in the case of a duplication Code: