Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.
Computer Hope forum e-mail issues and down time
0 Members and 1 Guest are viewing this topic.
This code is just to update the receiptno by adding 1 and displaying the value of receiptno.The only prob, it does neither.?? says "updated but NOT
<?php$link = mysqli_connect("localhost", "root", "", "homedb"); // Check connectionif($link === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); }$id = 'id';$receiptno='';/* Perform a query, check for error */$sql = "UPDATE control SET receiptno = '$receiptno' + 1 where id='$id'";echo $receiptno; if(mysqli_query($link, $sql)){ echo "updated"; } else { echo "ERROR: Could not able to execute $sql. " . mysqli_error($link); } // Close connectionmysqli_close($link); ?>