Forum Moderators: coopster
As mentioned it does get the ID and insert it
But not on the row where from the ID was taken
It does insert it on a new row created by the insert action
Which due to the auto increment creates a new ID etc...
How can I keep the original row and pass its ID # to the "member_web_address" col in the very same row
thanks
<?
$query = "select id from templates where username= '$username' and page= '$page' ";
$result= mysql_query ($query);
while($query_data=mysql_fetch_array($result))
{
$member_web_address=($query_data["id"]);
}
$query = "select id from templates where username= '$username' and page= '$page' ";
$result= mysql_query("insert into templates (member_web_address) values ('$member_web_address')");
?>
insert - inserts new rows into an existing table
UPDATE [mysql.com] - updates columns in existing table rows with new values. So..
update table templates set member_web_address = '$member_web_address' where .....