0

Title pretty much says it. I am using the deprecated mysql_ functions. I've got a query like:

UPDATE `table`
SET `row` = 'newtext'
WHERE `row` = 'oldtext'

Is there an easy way to get all effected row's primary key? Some glorious combination of mysql_insert_id and mysql_affected_rows? How can I do this without looping and doing each update one row at a time?

Andrea
  • 11,801
  • 17
  • 65
  • 72
I wrestled a bear once.
  • 22,983
  • 19
  • 69
  • 116

1 Answers1

1

As a solution to your problem please refer the following sample code snippet

  UPDATE `table` SET `row` = 'newtext' WHERE `row` = 'oldtext'

  select id from table where row='oldtext'
Rubin Porwal
  • 3,736
  • 1
  • 23
  • 26