Re: [PHP] coding MySQL error traps [WAS: mysql if empty]

2007-04-10 Thread Richard Lynch
On Tue, April 10, 2007 1:08 pm, Paul Novitski wrote: > mysql_query() returns true. This constitutes a hack because it > depends entirely on the way the parser processes code rather than on > explicit elements of the language. The order of execution and boolean short-circuit is a Documented Featur

Re: [PHP] coding MySQL error traps [WAS: mysql if empty]

2007-04-10 Thread Jim Lucas
Paul Novitski wrote: $sql = "SELECT Client FROM booked WHERE Name = 'larry'"; $result = mysql_query($sql) OR die('[MYSQL ERROR] - ['.mysql_errno().']'.mysql_error()); while ( list($client) = mysql_fetch_row($result) ) { echo "{$client}\n"; } I agree with this logic overall. The

[PHP] coding MySQL error traps [WAS: mysql if empty]

2007-04-10 Thread Paul Novitski
$sql = "SELECT Client FROM booked WHERE Name = 'larry'"; $result = mysql_query($sql) OR die('[MYSQL ERROR] - ['.mysql_errno().']'.mysql_error()); while ( list($client) = mysql_fetch_row($result) ) { echo "{$client}\n"; } I agree with this logic overall. The above is of course jus