954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Error Help - Query fatal error

I use the News-Engine 1.5.1 script in my website. He worked perfectly till now. It was replaced on the server now the MySQL. PHP 5.2.4 and MySQL 5.0.51 versions run on the server. During the run of the site, I get the following error message:

Error message: Query fatal error:
Query:UPDATE news1_news SET reads=reads+1 WHERE newsid='68'
Fehlermeldung: 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 'reads=reads+1 WHERE newsid='68'' at line 1

Script: /.../news/admin/enginelib/class.db.php ( on Line: 90)

Do you know any solution to this problem?

smartness
Junior Poster
103 posts since Aug 2007
Reputation Points: 7
Solved Threads: 14
 

Hey,

You could try adding a select subquery to your update query, e.g.

UPDATE `news1_news` 
SET `reads` = '([INDENT]SELECT `reads` 
FROM `news1_news` 
WHERE `newsid` = '68'
[/INDENT]) + 1'
WHERE `newsid` = '68'


The subquery should yield the result of the current value, which can then be incremented as required.

R.

blocblue
Posting Pro in Training
475 posts since Jan 2008
Reputation Points: 142
Solved Threads: 79
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You