# You have an error in your SQL syntax; check the manual that corresponds to your MySQL

**URL:** <https://forum.kirupa.com/t/you-have-an-error-in-your-sql-syntax-check-the-manual-that-corresponds-to-your-mysql/329306>\
**Category:** programming\
**Created:** [August 11, 2012, 10:01pm UTC](https://forum.kirupa.com/t/you-have-an-error-in-your-sql-syntax-check-the-manual-that-corresponds-to-your-mysql/329306 "2012-08-11T22:01:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scotty13](https://avatars.discourse-cdn.com/v4/letter/s/7bcc69/32.png) [@Scotty13](https://forum.kirupa.com/u/Scotty13)\
**Post date:** [August 11, 2012, 10:01pm UTC](https://forum.kirupa.com/t/you-have-an-error-in-your-sql-syntax-check-the-manual-that-corresponds-to-your-mysql/329306/1 "2012-08-11T22:01:26Z")

</div>

[COLOR=#ff0000]I have this Table, forum\_posts (forum I’m building).

[/COLOR]\<?php  
require\_once “connect\_to\_mysql.php”;// Tell ourselves on screen if we have connected  
print “Success in database CONNECTION…\<br /\>”;  
$result = "create table IF NOT EXISTS `forum_posts` (  
id int(11) NOT NULL AUTO\_INCREMENT,  
post\_author varchar(24) NOT NULL,  
post\_author\_id int(11) NOT NULL,  
otid int(11) NOT NULL,  
date\_time datetime NOT NULL default ‘0000-00-00 00:00:00’,  
replyButton int(11) NOT NULL,  
type enum(‘a’,‘b’) NOT NULL default,  
view\_count int(11) NOT NULL,  
section\_title varchar(88) NOT NULL,  
section\_id int(11) NOT NULL,  
thread\_title varchar(64) NOT NULL,  
thread\_id enum(‘a’,‘b’) NOT NULL default ‘a’,  
post\_body text NOT NULL,  
post\_title int(11) NOT NULL,  
all\_responses int(11) NOT NULL,  
forum\_section\_title int(11) NOT NULL,  
forum\_section\_id int(11) NOT NULL,  
this\_id enum(‘a’,‘b’) NOT NULL default ‘a’,  
tktedmembers\_id int(11) NOT NULL,  
PRIMARY KEY (id)  
) ";  
if (mysql\_query($result)){  
print “Success in TABLE creation!..  
\<br /\>\<br /\>\<b\>That completes the table setup, now delete the file \<br /\>  
named ‘forum\_posts’ and you are ready to move on. Let us go!\</b\>”;  
} else {  
print “no TABLE created. You have problems in the system already, backtrack and debug!”;  
echo "  
" . mysql\_error();  
echo mysql\_error();  
}  
exit();  
?\>

[COLOR=#ff0000]I get this error when testing in IE…

[/COLOR]Success in database CONNECTION…  
no TABLE created. You have problems in the system already, backtrack and debug! 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 ’ view\_count int(11) NOT NULL, section\_title varchar(88) NOT NULL, ’ at line 8. 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 ’ view\_count int(11) NOT NULL, section\_title varchar(88) NOT NULL, ’ at line 8.

Please Help!  
Scotty13
