wmguk Posted May 25, 2008 Share Posted May 25, 2008 Hey, This is my code: if ($ceremony == "Wedding" || "Civil Partnership") { //CONNECT TO our_info - Get the message to add to guestbook $result = mysql_query("SELECT * FROM our_info WHERE username = '$user'"); while($row = mysql_fetch_array($result)) { $guestmess = $row['guestmess']; $contact = $row['contact']; $contemail = $row['email']; //Add the message to Album Guestbook mysql_query("INSERT INTO guestbook( login, fromname, fromemail, message, iwauth, custauth) VALUES ('$login','$contact', '$contemail', '$guestmess', 'yes', 'yes');"); }} else { } However the OR function doesnt seem to work, I only want to add the message if ceremony is Wedding OR Civil Partnership. however it adds it no matter what the ceremony is? Any ideas? Link to comment https://forums.phpfreaks.com/topic/107177-solved-silly-query-error/ Share on other sites More sharing options...
trq Posted May 25, 2008 Share Posted May 25, 2008 You ought be using.... if ($ceremony == "Wedding" || $ceremony == "Civil Partnership") Link to comment https://forums.phpfreaks.com/topic/107177-solved-silly-query-error/#findComment-549489 Share on other sites More sharing options...
wmguk Posted May 25, 2008 Author Share Posted May 25, 2008 uggh! what a newbie mistake thanks for taking the time to point it out... you know when you look at something for so long and you just cant see the wood for the trees... Thanks again Link to comment https://forums.phpfreaks.com/topic/107177-solved-silly-query-error/#findComment-549490 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.