In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Jon Drukman) wrote:
> the idea being that if any of the commands in the block fail, the database > package automatically does a die("") and the block is terminated. > > the nearest i could get with php is: > > do { > mysql_query("UPDATE ..."); > if (mysql_error()) { $error.="Couldn't update: ". mysql_error(); break; } > > mysql_query("SELECT ..."); > if (mysql_error()) { $error.="Couldn't select: ". mysql_error(); break; } > > and so on.... > } while (0==1); > > if ($error) { do error stuff } > else { it worked } Have you read <http://www.php.net/manual/en/features.error-handling.php> yet? There are some ideas there which you might find useful. FWIW, there is a die() function in PHP, so you can simplify the above to: mysql_query("UPDATE ...") or die("Couldn't update: ". mysql_error()); mysql_query("SELECT ...") or die("Couldn't update: ". mysql_error()); -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]