Making a query issue

By Juan Montes


i’m making a query to insert some values to a table and update other in other table all this in the same function.

The problem i have is with the Insert query, when has been execute, give me a syntax error that you can see below.

I reviewed the code many times but i don’t see any error. When I remove the Insert query works fine and if I remove de update query and leave just the insert give me the same error.

Here the query

if (isset($_POST['goodalt']) && isset($_POST['gengood'])){
    $goodalt = mysqli_real_escape_string($con, $_POST['goodalt']);
    $genid = mysqli_real_escape_string($con, $_POST['gengood']);
        $res = mysqli_query($con, "SELECT * FROM `generators` WHERE `name` = '$genid'") or die(mysqli_error($con));
        while($row = mysqli_fetch_assoc($res)) {
            $genname = $row['name'];
    mysqli_query($con, "INSERT INTO `user_accounts` (`username`, `accs`, `genid`, `gen-name`, `date`, `status`) VALUES ('$username', '$goodalt', '$genid', '$genname', '$date', '1'") or die(mysqli_error($con));
    mysqli_query($con, "UPDATE `generator$genid` SET `status` = '3' WHERE `alt` = '$goodalt'") or die(mysqli_error($con));

Any help? Thanks.

Source: Stack Overflow


Share it with your friends!

    Fatal error: Uncaught Exception: 12: REST API is deprecated for versions v2.1 and higher (12) thrown in /home/content/19/9652219/html/wp-content/plugins/seo-facebook-comments/facebook/base_facebook.php on line 1273