Jump to content

Need help


h3ktlk

Recommended Posts

Tryinging to pull a recordset.

 

This is what i have:

 

mysql_select_db($database_wellness, $wellness);

$query_wellnesssessionbcount = "SELECT * FROM sessionb WHERE sessionb.`count`<30";

$wellnesssessionbcount = mysql_query($query_wellnesssessionbcount, $wellness) or die(mysql_error());

$row_wellnesssessionbcount = mysql_fetch_assoc($wellnesssessionbcount);

$totalRows_wellnesssessionbcount = mysql_num_rows($wellnesssessionbcount);

 

which works great but for one of the records i need it to be fore <20 not <30 ... is it possible to make an AND statment in there to do that somehow? pertaining to the id of the record possibly?

 

what i have is 12 records..  11 of them need pulled when count is less then 30  .. 1 of them needs pulled if count is less then 20.  Im using the data to fill a drop down menu.

 

 

 

Thanks!

Link to comment
Share on other sites

Just pull the record of all the ones that are <30, then when the id is for the record that should be <20, check its value and either process it or toss it out. No big deal to pull 1 extra record from MySQL, just process all 12 with a catch for the special circumstance.

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.