General Community > Scripting Help

mySQL Query help

(1/2) > >>

I'm trying to use this select statement but it doesn't seem to work.

FROM notifications
WHERE notifications.eventID =(SELECT events.eventID FROM events WHERE eventDate < CURRENT_DATE)

but i'm getting this error:

Error Code : 1064
You have an error in your SQL syntax near 'SELECT events.eventID FROM events WHERE eventDate < CURRENT_DATE)' at line 3

can someone please help?

Zef Hemel:
MySQL does not support subselects for as far as I know.

Read up on INNER JOIN and/or LEFT JOIN, that will do what you want.

yup, mysql doesnt support nested queries
you have to nest it in the php part

alright.. i'll do that. thnx a lot.. at least now i won't go crazy trying to figure it out..   ;D


[0] Message Index

[#] Next page

Go to full version