Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Sep 2011
    Location
    127.0.0.1
    Posts
    67
    Thanks
    19
    Thanked 0 Times in 0 Posts

    Problem with MySQLi insert syntax

    Hi. I have a problem with my MySQLi insert syntax, here it is:

    PHP Code:
    $con dbcon(); //Open db connection
    $result mysqli_query($con,"INSERT INTO `web_posts` (title_sk, date, owner, owner_id, category, category_id, content_sk, tags, show) VALUES ('".$postTitle."', '".timestamp()."', '".get_login()."', '".$_SESSION['user_id']."', '".$postCategory."', '".get_category_id($postCategory)."', '".$postText."', '".$postTags."', 'true')") or die(mysqli_error($con)); //Insert data to db
    mysqli_close($con); //Close db connection 
    MySQLi errors:
    Code:
    You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'show) VALUES ('Test test test!', '04.05.2014 16:18:43', 'admin', '1', 'News' at line 1
    My website is here: http://www.moowdesign.eu/. It is not complete yet, and I want to add language translations for some languages(including english).

  • #2
    Senior Coder Dormilich's Avatar
    Join Date
    Jan 2010
    Location
    Behind the Wall
    Posts
    3,284
    Thanks
    12
    Thanked 343 Times in 339 Posts
    show is a reserved keyword.
    The computer is always right. The computer is always right. The computer is always right. Take it from someone who has programmed for over ten years: not once has the computational mechanism of the machine malfunctioned.
    André Behrens, NY Times Software Developer


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •