Seach help.

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
redcircle
Forum Commoner
Posts: 43
Joined: Fri Jan 31, 2003 8:47 pm
Location: michigan, usa

Seach help.

Post by redcircle »

I need some help with a search script. mysql.com appears to be down right now. I know I need some left joins but i'm not sure of the syntax I need. Is there a mirror that has the docs?
User avatar
redcircle
Forum Commoner
Posts: 43
Joined: Fri Jan 31, 2003 8:47 pm
Location: michigan, usa

Post by redcircle »

which is faster

SELECT photofile.id as image_id, photodir.name as dir_name, access.r as read_access FROM photofile left join photodir on (photofile.dir_id = photodir.id) left join access on (photodir.id = access.dir_id) where access.user_id = 0

or

SELECT photofile.id as image_id, photodir.name as dir_name, access.r as read_access FROM photofile,photodir,access where access.user_id = 0 and photofile.dir_id = photodir.id and access.dir_id = photodir.id

both produce same results.

another question.

does it slow the left join statement to use the photofile.id as image_id?
Post Reply