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? Quote 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. Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.