return value of sql query

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
wlogeshwaran
Forum Newbie
Posts: 1
Joined: Fri Apr 15, 2011 6:47 am

return value of sql query

Post by wlogeshwaran »

This piece of code deletes the row having time less than system time.

1) $tim=time(); $timer=time()+100;
2) mysql_query("delete from test where time < $tim ");
3) mysql_query("update test set time=$timer where status='Waiting');


I want to execute line 3 , only when line 2 actually deletes a row in the table.

Suggest me an idea or tell me what i have to do to check whether line 2 has actually deleted the row. Tell me the return value of the sql query once it get executed.
User avatar
Darhazer
DevNet Resident
Posts: 1011
Joined: Thu May 14, 2009 3:00 pm
Location: HellCity, Bulgaria

Re: return value of sql query

Post by Darhazer »

Post Reply