Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: not updating  (Read 31795 times)

0 Members and 1 Guest are viewing this topic.

guitarzRus

    Topic Starter


    Rookie

    • Experience: Experienced
    • OS: Windows 7
    not updating
    « on: April 04, 2023, 11:38:56 AM »
    Quote
    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

    Code: [Select]
    <?php
    $link 
    mysqli_connect("localhost""root""""homedb"); 
    // Check connection
    if($link === false){ die("ERROR: Could not connect. " mysqli_connect_error()); }

    $id = &#39;id&#39;;
    $receiptno=&#39;&#39;;

    /* Perform a query, check for error */
    $sql "UPDATE control SET 
    receiptno = &#39;
    $receiptno&#39; + 1 where id=&#39;$id&#39;";
    echo 
    $receiptno;
     if(
    mysqli_query($link$sql)){ echo "updated"; } 
    else { echo 
    "ERROR: Could not able to execute $sql. " mysqli_error($link); }
     
    // Close connection
    mysqli_close($link); 
    ?>