Page 1 of 1
checking for mysql_pconnect error
Posted: Thu Jul 01, 2004 1:51 am
by pelegk2
how can i check,using which function whats execlly the error that occur on mysql_pconnect function?
thnaks in advance
peleg
Posted: Thu Jul 01, 2004 3:02 am
by markl999
http://php.net/mysql_error
Eg:
Code: Select all
$db = mysql_pconnect('...', '...', '...') or die(mysql_error());
Posted: Thu Jul 01, 2004 3:25 am
by pelegk2
ow and ithoguth that mysql_error() is only good to use with mysql_query()

:)
Posted: Thu Jul 01, 2004 3:28 am
by markl999
Nope

mysql_error() can be used on almost every mysql_* function (and should be used where possible).
I even use it when dining out with friends, it can even attract members of the opposite sex

Posted: Thu Jul 01, 2004 3:44 am
by pelegk2
hahahahahahahahahaha
Posted: Thu Jul 01, 2004 5:42 am
by Grim...
Mark - but when you have a SELECT query that returns 0 rows it fires the error.
Posted: Thu Jul 01, 2004 10:28 am
by feyd
uh.. not that I've ever seen Grim. The mysql functions return false when there's an error.
The only times you shouldn't really use mysql_error() is with mysql_num_rows() and the fetch_* triplets, because those return 0/false for special reasons..