MadnessRed Posted August 15, 2009 Share Posted August 15, 2009 I would like to update a table and read from it in 1 go if that is possible, something like $qry = mysql_query("UPDATE AND SELECT FROM `table` SET `group` = 0 WHERE `group` = '$group' ;"); $affected_members = array(); while($row = mysql_fetch_assoc($qry)){ $affected_members[] = $row['id'] ; } or mysql_query("UPDATE `table` SET `group` = 0 WHERE `group` = '$group' ;"); $affacted_members = mysql_affected_ids(); Is there a way to do this, or will I need 2 queries? Link to comment https://forums.phpfreaks.com/topic/170457-solved-update-and-select-at-the-same-time-or-at-least-return-affected-ids/ Share on other sites More sharing options...
tommyda Posted August 16, 2009 Share Posted August 16, 2009 Na you would need 2 queries as far as I know. Link to comment https://forums.phpfreaks.com/topic/170457-solved-update-and-select-at-the-same-time-or-at-least-return-affected-ids/#findComment-899583 Share on other sites More sharing options...
MadnessRed Posted August 17, 2009 Author Share Posted August 17, 2009 ok, thanks anyway Link to comment https://forums.phpfreaks.com/topic/170457-solved-update-and-select-at-the-same-time-or-at-least-return-affected-ids/#findComment-899974 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.