CodeIgniter Forums

Full Version: MySQL error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

Hi all,

after copying some files back to the server, I have some errors in my SQL. For example, this one:

A Database Error Occurred

Error Number: 1064

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 ') OR (users2users.validated = 1 AND users2users.user_id2 = 67)' at line 4

SELECT * FROM (`users2users`) JOIN `users` ON `users`.`id` = `users2users`.`user_id2` OR = users2users.user_id1 WHERE `(users2users`.`validated` = 1 AND users2users.user_id1 = 67) OR (users2users.validated = 1 AND users2users.user_id2 = 67)

The code is:
$where = "(users2users.validated = 1 AND users2users.user_id1 = " . $userid . ") OR (users2users.validated = 1 AND users2users.user_id2 = " . $userid . ")";

Why does this suddenly happen? It worked all fine before. Could there have been a mySQL upgrade on the server?

Kind regards, all help appreciated,

El Forum

Sorry guys, never mind. Solved.