Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/24/2024 in all areas

  1. Same thing using PHP <?php const HOST = '????'; const USERNAME = '????'; const PASSWORD = '????'; const DBNAME = '????'; $staffno = 3; $appno = 4; mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); // Tell mysql to report errors $conn = mysqli_connect(HOST,USERNAME,PASSWORD,DBNAME); // connect to DB $conn->set_charset('utf8'); ShowData($conn); $stmt = $conn->prepare("UPDATE test_91 SET staffno = ? WHERE appno = ? "); $stmt->bind_param('ii', $staffno, $appno); $stmt->execute(); echo "<br><b>Table updated here</b><br>"; ShowData($conn); function ShowData($conn) { $res = $conn->query("SELECT * FROM test_91"); echo '<pre>'; printf("%-10s%-10s%-10s<br><br>", 'AppID', 'AppNo', 'StaffNo'); foreach ($res as $row) { vprintf("%-10s%-10s%-10s<br>", $row); } echo "</pre>\n"; } ?> Output... AppID AppNo StaffNo 1 2 2 2 3 2 3 4 0 4 4 0 5 4 0 6 4 0 Table updated here AppID AppNo StaffNo 1 2 2 2 3 2 3 4 3 4 4 3 5 4 3 6 4 3
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.