I am in the process of teaching myself PHP/SQL.
I have a seemingly simple thing I'm trying to do. I have a field called "memberid" in my database that is populated with a unique number for each row. I have another field called "member_id" that I want to populate with the same number that is in the "memberid" field for each row.
At this point, if there is an easier method to do it, doesn't really matter. I want to figure out why this method won't work for me.
I wrote a simple script to try and do this for me, but it just doesn't work.
I have a seemingly simple thing I'm trying to do. I have a field called "memberid" in my database that is populated with a unique number for each row. I have another field called "member_id" that I want to populate with the same number that is in the "memberid" field for each row.
At this point, if there is an easier method to do it, doesn't really matter. I want to figure out why this method won't work for me.
I wrote a simple script to try and do this for me, but it just doesn't work.
Code:
$num=1;
while ($num <= 40) {
$query= "UPDATE members SET member_id='$num' WHERE memberid='$num'";
$num++;
}