我有一个错误:检查与您的MySQL服务器对应的手册

I keep getting the error:

error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE order_id = 100038' at line 1

upper part of my code where the problem should be:

$id     = $_GET["Ref"];
    $state  = 'Geannuleerd';
    if (!empty($id)){

        $con= mysqli_connect("**********","************","**************","**************");

        if (mysqli_connect_errno()) {
        printf("Connect failed: %s
", mysqli_connect_error());
        exit();
        }   

        $updquery = "UPDATE order SET order_state = '$state', WHERE order_id = $id";

        $updresult = mysqli_query($con, $updquery);
        if (!$updresult) {
        printf("error: %s
", mysqli_error($con));
        }

        mysqli_free_result($updresult);

        $mailquery = "SELECT * FROM order WHERE order_id ='". $id. "'";

        $mailresult = mysqli_query($con, $mailquery);
        if (!$mailresult) {
        printf("error: %s
", mysqli_error($con));
        }

Like i see it is the UPDATE statement that has a wrong syntax. The SELECT works perfectly!

Thanks for the help!

Remove comma before WHERE statement.

$updquery = "UPDATE order SET order_state = '$state' WHERE order_id = $id";