Jump to content

[SOLVED] mysql error


fantomel

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.