i'm not sure how to make this query...
i have two tables...work order and sets...
now, obviously work order creates and entry based upon info from the projects table and information which is entered into it...
but...i need to create a query that will automatically determine the next number in the sequence...or the first number in the sequence...this comes from the sets table (which i'm using only as a cound...i only has one column "sets_id" that counts from 1-200)...
now...my query selects from work order and sets to get the correct work orders, then i need to deselect any work order that currently has a set activated (i just use a '1' in a column called wo_set to determine this; wo_set_no is the actual number of the set)...so in effect, it returns no work orders but instead returns set_id's that are not currently active in the work order table so i can then just call the first unactive one into action...
this is the query...
SELECT sets_id,wo_set,wo_set_no,wo_proj_id FROM sets,wo WHERE wo_proj_id = $proj_id AND wo_set='1' AND wo_set_no != sets_id") or die ("Yo, it's not working! - Code1A."); $row_setno = mysql_fetch_array($query_setno);
i'm clearly missing something on this one...it keeps returning "2" back to me...and it returns nothing if i select a query that doesn't have any work orders set up for it in the test tables...
anyways...maybe some one might have an idea on this...
thanks...v