Weird PHP error: Cannot create MySQL database from a function?!!?
So I'm coding up the following example
PHP Code:
use the following php -a createmovie.php and I get this output Code:
mysql_create_db() is undefined??? I check here http://us2.php.net/mysql_create_db and it says that it is ok...so I'm really confused as to what is going on?!!? So php experts, let me know what you think... thanks |
It seems that your PHP installation can't find the mysql libraries... was it built with mysql support?
|
Your PHP is not build with MySQL support. Since PHP5 I think, it's optional, so you have to rebuild your PHP or install package with the MySQL module build. But check out the Apache module it may have the MySQL functions available.
|
Here is the output from my phpinfo.php about mysql
Code:
file, but someone was saying I have to compile in MySQL??? |
Taken from the php document link that you posted...
Note: This function will not be available if the MySQL extension was built against a MySQL 4.x client library. The recommendation in the documentation is: The function mysql_create_db() is deprecated. It is preferable to use mysql_query() to issue a sql CREATE DATABASE statement instead. |
Ok, so I changed
mysql_create_db to mysql_query() ...and was able to create the database and tables successfully. Thanks for you help! |
All times are GMT -5. The time now is 07:33 PM. |