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.