|
Posted by Erwin Moller on 05/18/07 15:14
Robertu wrote:
> Hi alt all
Hi Robertu,
> $connection = mysql_connect("12.34.5.67.89", "Sql111111","hELLOWORLD");
mysql_connect returns a value.
Check at www.php.net for details.
In this case FALSE is returned if the mysql_connect fails.
So you'll end up with something like this:
$connection = @mysql_connect("12.34.5.67.89", "Sql111111","hELLOWORLD");
if ($connection === FALSE){
echo "problem connecting...";
exit;
}
2 notes:
- The @ supresses a possible errormessage.
- the === is NOT a typo.
> mysql_select_db("11111111_1")
Also, check www.php.net for returnvalues.
> $query = "SELECT from where...............
This will probably not produce an error since you only construct the string.
But when you execute it you can get an error.
Also, check the returnvalue here too.
Good luck!
Regards,
Erwin Moller
> in any of these 3 steeps it can make error or any visitor can try to call
> a different database or make irs own query
> what can I do To be sure that on error in any of these 3 seep the PHP code
> self call a certain page?
> Thank you in advance and regards
[Back to original message]
|