Page 1 of 1

[SOLVED] error checking

Posted: Mon Apr 11, 2005 1:14 am
by Jim_Bo
Hi,

Should something like this work .. it only seems to prompt if there is an error in sql1 put still passes if there is an error in sql2

Code: Select all

} else {
 
$sql1 = "INSERT INTO table (..) VALUES(..";

$result1 = mysql_query($sql1);

$sql2 = "INSERT INTO table (..) VALUES('..)";

$result2 = mysql_query($sql2);


if ((!$result1) || (!result2)) {

echo 'error'; 

} else {

echo 'successs';
Thanks

Posted: Mon Apr 11, 2005 2:10 am
by s.dot
you need to put a $ in (!$result1 || !result2)

:)

Posted: Mon Apr 11, 2005 6:14 am
by Jim_Bo
Hi

Doh, looked over and over and over .. didnt see it

I guess a coffee break was in order

Thanks

Posted: Mon Apr 11, 2005 6:23 am
by s.dot
Happens to me all of the time.