Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
05-04-2014, 03:47 PM #1
- Join Date
- Sep 2011
- Thanked 0 Times in 0 Posts
Problem with MySQLi insert syntax
Hi. I have a problem with my MySQLi insert syntax, here it is:
$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
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 1My website is here: http://www.moowdesign.eu/. It is not complete yet, and I want to add language translations for some languages(including english).
05-05-2014, 11:14 AM #2
- Join Date
- Jan 2010
- Behind the Wall
- Thanked 402 Times in 398 Posts
showis 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