Forum Moderators: open

Message Too Old, No Replies

Help with mysql and join

         

s0h31l

4:34 pm on Jan 21, 2008 (gmt 0)

10+ Year Member



Hello everyone....

im tryin to create a message system in my webstie between users..

i got this error:
The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET SQL_MAX_JOIN_SIZE=# if the SELECT is okay

i use the following query to show their messages in inbox folder..

SELECT *
FROM TblMsgs, TblUsers

WHERE (
(
(TblMsgs.user_id_from = $loginID
AND TblMsgs.user_id_to = TblUsers.id)
OR
(TblMsgs.user_id_to = $loginID
AND TblMsgs.user_id_from = TblUsers.id)
)

ORDER BY time DESC

lets say user A is logged in....

it is 2 cases :
1- when user A send user B a message
then TblMsgs.user_id_from is ID of user A

2- when user B send user A a message
then TblMsgs.user_id_to is ID of user A

in both cases we need to have information of user B to show it beside message... so
in first case : TblMsgs.user_id_to = TblUsers.id
and in second case: TblMsgs.user_id_from = TblUsers.id

anywayz this was workin befor on some other server....

any idea how i can have same information with another query?

vincevincevince

11:44 am on Jan 23, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Edit your /etc/mysql.conf file and increase MAX_JOIN_SIZE until the problem goes away. Restart mysql each time.