02082006 1242 GMT-6 Im working on this little project and I keep running into this error. Problem is I dont know what the error is. I have in a if statement to print out the mysql_error() if there is a problem but the statement only prints out: Could not connect to Mysql because: . It doesnt print out the error. But here is the really odd thing: I have two of these scripts. One works, one doesnt. Both use the same user and password and I just dont see a problem.
Im using mysql 4.1 and php 4 and apache2 on Ubuntu. Wade Here is the script: <!DOCTYPE html PUBLIC "~//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmls="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html1; charset=iso-8859-1"/> <title>Connect to Specific MySQL Database</title> </head> <body> <?php // Script 12.1 - mysql_connect.php ini_set('display_erors', 1); error_reporting(E_ALL & ~E_NOTICE); // Try connection, print any message if ($dbc = @mysql_connect('localhost', 'user', 'pass')) { print '<p>Successfully connected to MySQL.</p>'; if (@mysql_select_db ('Homes')) { print '<p>The database has been selected.</p>'; } else { die ('<p>Could not select the database because: <br /><b>' . mysql_error() . '</b></p>'); } mysql_close(); } else { die (print '<p>Could not connect to MySQL because: <br /><b>' . mysql_error() . ' </b></p>'); } ?> </body> </html> The php_mysql group is dedicated to learn more about the PHP/MySQL web database possibilities through group learning. Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php_mysql/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
