Jump to content

conditional query?


kmadden84

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/265220-conditional-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.