I have the following function in a php file name mySQL.php
Code: Select all
function queryDatabase($query, $link){
$result = mysql_query($query, $link);
return $result;
}
i use include("mySQL.php") in another file called Messaging.php, then after connecting successfully, i run the script:
Code: Select all
$query = "CREATE Database Messaging";
$result = queryDatabase($query, $link) or die("Failed to Create Database");
I get the message Failed to Create Database, but is there any way in which i can check the exact error message which is returned by my queryDatabase function? i.e. doing something with $result?
Thanks
Richard.