-3

Im not very experienced with PHP so I don't fully understand the syntax of PHP or MySQL Ive tried to tweak my code to create a row to update a row. this is the my attempt to update the row.

$sql = "UPDATE  `" . $table . "`SET (Expire_Date, HWID, IP_ADDRESS, PC_NAME) VALUES (?,?,?,?);";
$stmt = mysqli_stmt_init($link);

if (!mysqli_stmt_prepare($stmt, $sql)) {
    echo " sql key_register function failed";
} else {
    mysqli_stmt_bind_param($stmt, "ssss", $exp_date, $hwid, $ipaddress, $pcname);
    mysqli_stmt_execute($stmt);
    echo "licence activated";
}

I think my issue is the SQL syntax, I could just expand the code out and make a big mess but I like doing it this way because it 'seems' tidy I guess. Could someone show me what I am doing incorrectly.

Ramen
  • 1
  • 2

1 Answers1

0

use correct UPDATE syntax:

$sql = "UPDATE  `" . $table . "`SET Expire_Date = ', HWID = ?, IP_ADDRESS = ?, PC_NAME = ?";
draz
  • 734
  • 5
  • 10