update a specific record from the list of array mysql

為{幸葍}努か 提交于 2019-12-11 23:17:52

问题


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.



来源:https://stackoverflow.com/questions/11295994/update-a-specific-record-from-the-list-of-array-mysql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!