Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP code Still not updating SQL
    primarykey
    data
    text
    <p>Relating to a previous question i had</p> <p><a href="https://stackoverflow.com/questions/18764576/sql-not-updating-from-php-form">SQL not Updating from PHP form</a></p> <p>I have changed and played with the code but am getting the following errors.</p> <pre><code>Query was emptyArray ( [imei] =&gt; 1 [serial] =&gt; 1 [status] =&gt; 1 [msisdn_no] =&gt; 0827910119 [card_no] =&gt; 89604900000001868482 [client_name] =&gt; 1 [inst_date] =&gt; 2013-09-10 [tech] =&gt; 1 [inst_cert] =&gt; 1 [isp] =&gt; Vodacom [account] =&gt; 1 [account_price] =&gt; 1 [deposit] =&gt; 1 [cont_start] =&gt; 1 [cont_end] =&gt; 1 [rica] =&gt; 1 [date_rica] =&gt; 1 [prod] =&gt; 1 [active] =&gt; 1 [suspended] =&gt; 1 [loaded_by] =&gt; 1 [send] =&gt; Submit ) : mysql err no : 1065 Your Number has been registered and Location has been Captured. Please click here for your Map and Location </code></pre> <p>This is my update PHP code </p> <pre><code>//Drawn from Form Information used to Update Database $imei = $_POST['imei']; $serial = $_POST['serial']; $status = $_POST['status']; $msisdn_no = $_POST['msisdn_no']; $card_no = $_POST['card_no']; $client_name = $_POST['client_name']; $inst_date = $_POST['inst_date']; $tech = $_POST['tech']; $inst_cert = $_POST['inst_cert']; $isp = $_POST['isp']; $account = $_POST['account']; $account_price = $_POST['account_price']; $deposit = $_POST['deposit']; $cont_start = $_POST['cont_start']; $cont_end = $_POST['cont_end']; $rica = $_POST['rica']; $date_rica = $_POST['date_rica']; $prod = $_POST['prod']; $suspended = $_POST['suspended']; $loaded_by = $_POST['loaded_by']; $id =$_POST['id'] ; //update database update_lbs($msisdn, $reqby1, $reqdate, $reqtime, $client, $clientcase, $saps, $cas, $reason, $reqby, $long, $lat, $msisdn, $dist, $response); //update database function update_lbs($imei, $serial, $status, $msisdn_no, $card_no, $client_name, $inst_date, $tech, $inst_cert, $isp, $account, $account_price, $deposit, $cont_start, $cont_end, $rica, $date_rica, $prod, $suspended, $loaded_by) { global $host; global $username; global $password; global $db_name; date_default_timezone_set('Africa/Johannesburg'); $today = date("Y-m-d H:i:s"); $date = date("Y-m-d") ; $time = date("H:i:s"); $insertSuccessful = false; if ($con = mysql_connect($host, $username, $password)) { if (mysql_select_db($db_name)) { $query = "UPDATE tracking_sim SET imei = '$imei', serial = '$serial', status = '$status', msisdn_no = '$msisdn_no', card_no = '$card_no', client_name = '$client_name', tech = '$tech', inst_cert = '$inst_cert', isp = '$isp', account = '$account', account_price = '$account_price', deposit = '$deposit', cont_start = '$cont_start', cont_end = '$cont_end', rica = '$rica', date_rica = '$date_rica', prod = '$prod', date_rica = '$date_rica', suspended = '$suspended', loaded_by = '$loaded_by' WHERE id = '$id';"; if (mysql_query($sql, $con)) { $insertSuccessful = true; } else { echo mysql_error (); echo $sql; print_r($_POST); echo mysql_errno($link) . ": " . mysql_error($link) . "\n"; echo "mysql err no : " . mysql_errno($con); } return $insertSuccessful; } } } ?&gt; </code></pre> <p>My form has the following </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"); // get value of id that sent from address bar $id = $_GET['id']; $result = mysql_query("SELECT * FROM tracking_sim WHERE id='$id'"); $rows = mysql_fetch_array($result); ?&gt; &lt;form id="form1" method="post" action="../control_tracking/tracking_sim_updated.php"&gt; </code></pre> <p>I have tried the form action with both GET and POST same error also I have changed $_POST to $_REQUEST and tried it that way as well with no avail </p>
    singulars
    1. This table or related slice is empty.
    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.
 

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