I have a table (table_D) populated with identical integers (num_to_change) for one field (dlr_id) and need to UPDATE them all to become unique numeric identifiers for each individual row. (The table's id field is already set to auto-incremented for each of these rows).
I'm floundering trying to iterate or increment a query like "UPDATE table_D SET dlr_id = (some incremented value) WHERE dlr_id = (num_to_change)";
I realize this sounds relatively simple, but for some reason I'm stalled. I've tried wrapping it in 'while', 'for' and 'if' statements but succeed only in updating ALL the (num_to_change) to a single value...which just replaces all the records with another identical integer.
The PHP is no sweat...it's getting the unigue integers into the MySQL db that is causing me headaches.
Any suggestions appreciated.
I'm floundering trying to iterate or increment a query like "UPDATE table_D SET dlr_id = (some incremented value) WHERE dlr_id = (num_to_change)";
I realize this sounds relatively simple, but for some reason I'm stalled. I've tried wrapping it in 'while', 'for' and 'if' statements but succeed only in updating ALL the (num_to_change) to a single value...which just replaces all the records with another identical integer.
The PHP is no sweat...it's getting the unigue integers into the MySQL db that is causing me headaches.
Any suggestions appreciated.