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?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.