Please remember to write your response BELOW the previous text. --- In php-list@yahoogroups.com, James Keeline <[EMAIL PROTECTED]> wrote: > > --- Justin <[EMAIL PROTECTED]> wrote: > > > i need to have a record pull data that count is less then 30 in all > > the records, but i need to have it less then 20 in one of the records. > > Possible in one record set? > > > > what i have: > > > > SELECT * > > FROM sessiona > > WHERE sessiona.`count`<30 > > > > <php > > mysql_select_db($database_wellness, $wellness); > > $query_wellnesssessionacount = "SELECT * FROM sessiona WHERE > > sessiona.`count`<30"; > > $wellnesssessionacount = mysql_query($query_wellnesssessionacount, > > $wellness) or die(mysql_error()); > > $row_wellnesssessionacount = mysql_fetch_assoc($wellnesssessionacount); > > $totalRows_wellnesssessionacount = mysql_num_rows($wellnesssessionacount); > > ?> > > > > > > but in one of the records count can needs to be <20 > > > > is there a way to do AND so and so is less then 20? > > > It's not clear to me what is different about your query when count<30 vs > count<20. You say that you want this to be in a single record set. I guess by > this you mean the same result for the query. You can use UNION to combine two > queries into a single record set IF the columns are the same: > > $q = "SELECT * FROM table_a WHERE count<30 > UNION > SELECT * FROM table_b WHERE count<20"; > > This example assumes that table_a and table_b have the same columns. > > Maybe if we knew a little more about your data and goals we could be more > helpful. > > James > --------------------
Heres little more information on this. There are 12 classes ppl are choosing from a drop down menu that is populated by this recordset. Once they select and hit register it places them into that class and adds 1 to a count field. When 30 ppl are signed up it should no longer appear in the drop down menu... that part is easy.. the problem is all the classes except the one can have 30 ppl. The one expection class is only allowed to have 20 ppl in it. Hope this helps.