fantomel Posted August 30, 2008 Share Posted August 30, 2008 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 '-5, 5' at line 1 -- this is the error that gives on the page CREATE TABLE IF NOT EXISTS `news` ( `id` int(11) NOT NULL auto_increment, `title` varchar(40) NOT NULL, `author` varchar(50) NOT NULL, `date` date NOT NULL, `news` text NOT NULL, `full_story` mediumtext NOT NULL, `filename` varchar(50) NOT NULL, `email` varchar(35) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=3 ; -- this is my table $id = $_GET['id']; $sql = mysql_query("SELECT DISTINCT FROM `full_story` WHERE id = '$id'") or die(mysql_error()); $row = mysql_fetch_array($sql); echo $row['full_story']; -- and this is my php code can someone help me please ? Link to comment https://forums.phpfreaks.com/topic/121987-solved-mysql-error/ Share on other sites More sharing options...
PFMaBiSmAd Posted August 30, 2008 Share Posted August 30, 2008 If that error was produced by that query, it means that $id contains '-5, 5', which means that $_GET['id'] contains '-5, 5'. You would need to find out why your code is putting ?id=-5, 5 on the end of the url. Link to comment https://forums.phpfreaks.com/topic/121987-solved-mysql-error/#findComment-629664 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.