every time you use @ in front of the function call, it'll suppress error messages for that function. What you need to do is remove @.
for example bad -> @mysql_connect good -> mysql_connect Wade Smart <[EMAIL PROTECTED]> wrote: 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. SPONSORED LINKS American general life and accident insurance company American general life insurance company American general life American general mortgage American general life insurance Computer internet security --------------------------------- YAHOO! GROUPS LINKS Visit your group "php_mysql" on the web. To unsubscribe from this group, send an email to: [EMAIL PROTECTED] Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service. --------------------------------- ~moe --------------------------------- Yahoo! Mail - Helps protect you from nasty viruses. [Non-text portions of this message have been removed] 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/
