Note that there are some explanatory texts on larger screens.

plurals
  1. POUpdate SQL tables
    primarykey
    data
    text
    <p>I want to update a table on a specific row need some advice on my php statement</p> <p>I use this statement to call the client's info </p> <pre><code>&lt;?php $host="localhost"; // Host name $username="****"; // Mysql username $password="****"; // Mysql password $db_name="****"; // Database name $tbl_name="members"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // get value of id that sent from address bar $id=$_GET['id']; // Retrieve data from database $sql="SELECT * FROM $tbl_name WHERE member_msisdn='$query'"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); ?&gt; </code></pre> <p>This works fine echoíng the information I need and able to alter it. </p> <pre><code>&lt;form name="form1" method="post" action="control_clientupdated.php"&gt; </code></pre> <p>This referes to my action php script</p> <p>Problem I need assistance with is how do i notify my action script to use the same id I ran the query on to update that row.</p> <pre><code>// Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // update data in mysql database $sql="UPDATE $tbl_name SET member_name='$member_name', member_surname='$member_surname', member_msisdn='$member_msisdn', cid='$cid', cofficenr='$cofficenr', cfax='$cfax', e2mobile='$e2mobile' WHERE member_msisdn='$query'"; $result=mysql_query($sql); </code></pre> <p>I have placed the WHERE statement on the end of the update</p> <p>Let me just state it shows done, but it did not update the table at all</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload