Connecting to mysql very very very confused. :(

gesf

New member
You won't get nothing, unless you make some output or condition for it.
That means that the connection function should return true (1) in case of success and false (0) otherwise. However you won't get true in success case but a MySQL link identifier. Anyway... a great way for you to know is running a query.
You also have a great example in the manual:
Code:
<?php

$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
if(!$link) {
   die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);

?>
 
The script that gesf gave you should always output something...

Do you have a URL to that mysqlconnect.php?
 
Coditor is right. Or show us the code you're using in that file (all the code).. if possible :p
Also you should always use error reporting:
Code:
<?php

# at first in yur code
error_reporting(E_ALL);

?>
 
Back
Top