PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Jim_Bo
Forum Contributor
Posts: 390 Joined: Sat Oct 02, 2004 3:04 pm
Post
by Jim_Bo » Mon Apr 11, 2005 1:14 am
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
s.dot
Tranquility In Moderation
Posts: 5001 Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana
Post
by s.dot » Mon Apr 11, 2005 2:10 am
you need to put a $ in (!$result1 || !result2)
Jim_Bo
Forum Contributor
Posts: 390 Joined: Sat Oct 02, 2004 3:04 pm
Post
by Jim_Bo » Mon Apr 11, 2005 6:14 am
Hi
Doh, looked over and over and over .. didnt see it
I guess a coffee break was in order
Thanks
s.dot
Tranquility In Moderation
Posts: 5001 Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana
Post
by s.dot » Mon Apr 11, 2005 6:23 am
Happens to me all of the time.