update a specific record from the list of array my

2019-09-16 05:56发布

问题:

I have a table user_instance. It has three fields: account_id, instance_name, host_name.
For Example, the records are like this.

account_id     instance_name      host_name
------------------------------------------
    1          instance_name1     localhost
    1          instance_name1     % 
    1          instance_name2     localhost
    2          instance_name1     localhost

And I am getting instance_name and host_name in an array of text boxes.

$result=mysql_query("SELECT user_instance.instance_name, user_instance.host_name FROM
dba_account, user_instance WHERE dba_account.account_id = user_instance.account_id AND 
dba_account.account_id = '1'");

while($note = mysql_fetch_array($result))
{
<inut type='text' name='instance_name' class='instance_name' disabled='disabled' 
value='$note[instance_name]' size='25' />
<input type='text' name='host_name' class='host_name' disabled='disabled' 
value='$note[host_name]' size='25' /> 
}

now when I click on the update button, it should update the specific record that I have made changes to. For example, if I change instance_name instance_name1 or host_name localhost of account_id 1, then it should update that record. I appreciate any help.

回答1:

you are never executing an UPDATE command.