So you just want to go through every row in the table updateing each one at a time?
There are several ways of doing this, and this may not be the best way, but its the way that looks the clearest and it will work. (I'm paranoid with a bug with fetch_array atm 😃)
$query = mysql_query("select * from table_name");
while ($rows = mysql_fetch_array($query))
{
$id[] = $rows[id];
$name[] = $rows[name];
$email[] = $rows[email];
$code[] = $rows
;
$ip[] = $rows[ip];
}
for ($i=0;$i<count($id);$i++)
{
$query = "update table_name set name='$name[$i]', email='$email[$i]', code='$code[$i]', ip='$ip[$i]' where id='$id[$i]";
$result = mysql_query($query);
}
That should work.