Thread: query problem
View Single Post
  #3 (permalink)  
Old December 1st, 2006, 02:53 PM
jlh42581 jlh42581 is offline
Registered User
 
Join Date: Dec 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by jlh42581
 First things first.

I dont notice in your table structures that you have and foriegn key restrictions on the sno column stating that they must resemble one another. Could be wrong as Im used to postgreSQL and not mySQL.

After you have that setup, maybe you already do. You just need a join the tables to query from both.

select i.snow,i.product_status from itemdetails as i,products as p where i.sno=p.sno;

Then your returned 2 columns, the primary key/id and the string your looking for.

In your sql loop, create an if

if(return[1] == "inactive){
  do somthing
}
else{
  do somthing else
}

Reply With Quote