Re: [PHP] Fatal error: Call to undefined function mysql_create_db()
This function is deprecated, and you ought to use mysql_query() to send the CREATE DB sql anyway -- So the book is either out-dated or just plain bad. If the function doesn't exist, then you either don't have MySQL extension to PHP installed, or your ISP has removed that function. On Sat, May 27, 2006 5:02 am, Mark Sargent wrote: Hi All, I get the following, *Fatal error*: Call to undefined function mysql_create_db() in */usr/local/apache2/htdocs/createmovie.php* on line 6 for this code, 5 //create the moviesite database 6 mysql_create_db(moviesite) or die(mysql_error()); which is from a tutorial in the book I'm using. Any pointers? Code looks identical to the book's. Cheers. P.S. I also tried this, mysql_create_db(moviesite, $connect) or die(mysql_error()); and mysql_create_db(moviesite, $connect) or die(mysql_error()); Mark Sargent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Fatal error: Call to undefined function mysql_create_db()
Have you created a connection to the Server with the correct permissions? -Original Message- From: Mark Sargent [mailto:[EMAIL PROTECTED] Sent: Saturday, May 27, 2006 5:03 PM To: PHP List Subject: [PHP] Fatal error: Call to undefined function mysql_create_db() Hi All, I get the following, *Fatal error*: Call to undefined function mysql_create_db() in */usr/local/apache2/htdocs/createmovie.php* on line 6 for this code, 5 //create the moviesite database 6 mysql_create_db(moviesite) or die(mysql_error()); which is from a tutorial in the book I'm using. Any pointers? Code looks identical to the book's. Cheers. P.S. I also tried this, mysql_create_db(moviesite, $connect) or die(mysql_error()); and mysql_create_db(moviesite, $connect) or die(mysql_error()); Mark Sargent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function mysql_create_db()
On Sat, May 27, 2006 11:02, Mark Sargent wrote: Hi All, I get the following, *Fatal error*: Call to undefined function mysql_create_db() in */usr/local/apache2/htdocs/createmovie.php* on line 6 Sounds like you don't have the MySQL component of PHP installed. If you're using the packaged version for your OS (of PHP), check that you installed the php-mysql package (your package manager should let you search for it). If you're using a self-compiled PHP, sounds like you didn't compile in MySQL(i) support. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function mysql_create_db()
Peter Lauri wrote: Have you created a connection to the Server with the correct permissions? Hi All, sorry, meant to post that too, 1 ?php 2 //connect to MySQL 3 $connect=mysql_connect(localhost, root, password omitted) or die(Hey, check your server connection.); I get no error for that line. Cheers. Mark Sargent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function mysql_create_db()
Mark Sargent wrote: Peter Lauri wrote: Have you created a connection to the Server with the correct permissions? Hi All, sorry, meant to post that too, 1 ?php 2 //connect to MySQL 3 $connect=mysql_connect(localhost, root, password omitted) or die(Hey, check your server connection.); I get no error for that line. Cheers. Hi All, seems that I was using a deprecated function. Cheers. Mark Sargent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Fatal error: Call to undefined function mysql_create_db()
//[dv] depricated //http://us2.php.net/manual/en/function.mysql-create-db.php //return mysql_create_db($name, $db); //[dv] this is not a good way to do this, as it doesn't tell you if it succeeded or not. //return mysql_query(CREATE DATABASE IF NOT EXISTS .$name); //this returns error 1007 if it exists already return mysql_query(CREATE DATABASE .$name); -Original Message- From: Mark Sargent [mailto:[EMAIL PROTECTED] Sent: Saturday, May 27, 2006 3:03 AM To: PHP List Subject: [PHP] Fatal error: Call to undefined function mysql_create_db() Hi All, I get the following, *Fatal error*: Call to undefined function mysql_create_db() in */usr/local/apache2/htdocs/createmovie.php* on line 6 for this code, 5 //create the moviesite database 6 mysql_create_db(moviesite) or die(mysql_error()); which is from a tutorial in the book I'm using. Any pointers? Code looks identical to the book's. Cheers. P.S. I also tried this, mysql_create_db(moviesite, $connect) or die(mysql_error()); and mysql_create_db(moviesite, $connect) or die(mysql_error()); Mark Sargent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php