kmadden84 Posted July 4, 2012 Share Posted July 4, 2012 Hello, I'm interested in running a query, but only if an earlier query pulls a result. 1st query: $query= mysql_num_rows(mysql_query("SELECT * FROM Table1 WHERE Column1='$var1'")); if($check="1") { ?> <br> <font size="2" face="Arial, Helvetica, sans-serif">The Serial <i><b><?php echo "$varSerial"; ?></b></i> is Valid. Checking eligibility</font> <?php } else <<<---HERE IS WHAT I NEED HELP WITH { ?> <br> What can I put here so that if $check="0", (serial invalid) the next query is Not Run. Is there something like an "else end(serial invalid- redirecting to purchase page)" eg. $query2= mysql_num_rows(mysql_query("SELECT * FROM Table1 WHERE Column2='$var1'")); etcetc.. Any input is much appreciated. I'm a big time beginner. Quote Link to comment https://forums.phpfreaks.com/topic/265220-conditional-query/ Share on other sites More sharing options...
Pikachu2000 Posted July 4, 2012 Share Posted July 4, 2012 When posting code, enclose it within the forum's . . . BBCode tags. What is it doing that it should not be doing, or not doing that it should be doing right now? IOW, how is it currently not working? Quote Link to comment https://forums.phpfreaks.com/topic/265220-conditional-query/#findComment-1359199 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.