MySQL error

#1
[eluser]webnology[/eluser]
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 users.id = users2users.user_id1 WHERE `(users2users`.`validated` = 1 AND users2users.user_id1 = 67) OR (users2users.validated = 1 AND users2users.user_id2 = 67)

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



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,
M

#2
[eluser]webnology[/eluser]
Sorry guys, never mind. Solved.

Thx,
M


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.