# SQL syntax error:

**URL:** <https://forum.kirupa.com/t/sql-syntax-error/233369>\
**Category:** programming\
**Created:** [July 23, 2007, 2:20pm UTC](https://forum.kirupa.com/t/sql-syntax-error/233369 "2007-07-23T14:20:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eshwarcharis](https://avatars.discourse-cdn.com/v4/letter/e/848f3c/32.png) [@eshwarcharis](https://forum.kirupa.com/u/eshwarcharis)\
**Post date:** [July 23, 2007, 2:20pm UTC](https://forum.kirupa.com/t/sql-syntax-error/233369/1 "2007-07-23T14:20:59Z")

</div>

Hi, I´m new to this forum and also to PHP & MYSQL.  
Im doing this mysql table review, everything has gone right, untill now.  
I did the database, and now i have to do the table, it looks like this:

CREATE TABLE `review` (  
`id_review` tinyint(4) NOT NULL auto\_increment,  
`food_rating` tinyint(3) unsigned default ‘0’,  
`service_rating` tinyint(3) unsigned default ‘0’,  
`decoration_rating` tinyint(3) unsigned default ‘0’,  
`price_rating` tinyint(3) unsigned default ‘0’,  
`review_text` text,  
`review_timestamp` timestamp(10) NOT NULL,  
`id_address` int(11) NOT NULL default ‘0’,  
`id_restaurant` int(11) NOT NULL default ‘0’,  
PRIMARY KEY (`id_review`)  
) TYPE=MyISAM AUTO\_INCREMENT=14 ;

And this is my PHP Code :

\<?php

/\*\*

- addReviewRestaurant.php  
\*/

require\_once (‘local.php’);

$food\_rating = get\_from\_request(‘food\_rating’);  
$service\_rating = get\_from\_request(‘service\_rating’);  
$decoration\_rating = get\_from\_request(‘decoration\_rating’);  
$price\_rating = get\_from\_request(‘price\_rating’);  
$review\_text = get\_from\_request(‘review\_text’);  
$review\_timestamp = get\_from\_request(‘review\_timestamp’);

$review = createReview($food\_rating, $service\_rating, $decoration\_rating, $price\_rating, $review\_text, $review\_timestamp,

$address, $restaurant);

connectToDb();  
addReviewIntoDb($review);

$msg = 'The review for the restaurant was added. ';

$page = ‘myspace1.php’;

require\_once ($FILE\_TEMPLATE\_PROCESSOR);

?\>

And i get this error:  
Could not connect: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 ’ )’ at line 1

I have checked in the manual and the error is Error: 1064 SQLSTATE: 42000 (ER\_PARSE\_ERROR) Message: %s near ‘%s’ at line %d.

I have gone through this several times but i didnot get where the error is? and how to solve this problem.

Any help will be appreciated.

Regards,  
charis.
