View Single Post
Old 2003-09-13, 05:17 PM   #12
venturi
No offence Apu, but when they were handing out religions you must have been out taking a whizz
 
Join Date: Apr 2003
Location: An Oasis atop a High Desert Mesa
Posts: 282
Send a message via ICQ to venturi
Good point Alex!

Another tip is to always perform your own error handling. For example:
PHP Code:
<?php
$query 
"SELECT * FROM my_table WHERE my_field='some_value'";
// note that I preceed all mysql calls with @ to supress the default error handling
$result = @mysql_query($query);
// now I am testing to see if I get a valid result
if ( ! $result) {
  echo @
mysql_error();
  break;
}

// now I process the results
while ($my_row = @mysql_fetch_assoc($result)) {
  
// here I do something spectacular with the data
}
?>
venturi is offline   Reply With Quote