Creating Database Using PHP
Posted: Fri Oct 24, 2008 11:21 am
I have the following function in a php file name mySQL.php
i use include("mySQL.php") in another file called Messaging.php, then after connecting successfully, i run the script:
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.
Code: Select all
function queryDatabase($query, $link){
$result = mysql_query($query, $link);
return $result;
}
Code: Select all
$query = "CREATE Database Messaging";
$result = queryDatabase($query, $link) or die("Failed to Create Database");
Thanks
Richard.