--- Ron Guilmet <[EMAIL PROTECTED]> wrote:

> I am trying to insert a article title and article.
> 
> I will show the error then the code.
> 
> ''''''''''''''''''
> 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 'title here)' at line 1
> ''''''''''''''''''
> 
> However line 1 is comments, but as we know the debugging is not
> specific with php.
> 
> Without the insert code, I can process the page.
> 
> handling page
> '''''''''''''''''
> $add_post_sql = "INSERT INTO articles (title, article) VALUES
> ($sForm,$postedValue)";

Line 1 refers to the SQL query not the PHP code.  It is an SQL error, after
all.

You should put single quotes around the value variables:

$add_post_sql = "INSERT INTO articles (title, article) VALUES ('$sForm',
'$postedValue')";

James

Reply via email to