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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.