Thread: sql / php
View Single Post
Old 11-14-2005, 12:59 PM   #2 (permalink)
teknomage1
Jack of all trades
 
teknomage1's Avatar
 
Join Date: Feb 2005
Location: Los Angeles
Posts: 598
teknomage1 is on a distinguished road
Send a message via AIM to teknomage1
Well as a general style thing, I'd say you should capitalize your sql commands to make them distinct, e.g. "SELECT field2 FROM table1 WHERE id = 7" versus "select field2 from table1 where id = 7" Also I'm pretty sure you don't need to explicitly call the join command to perform a join, rather it automatically joins when you select from multiple tables.
I think a proper join would be "SELECT student.name, student.grade, instrucor.name FROM student, instructor WHERE instructor.id = student.instructor_id"
__________________
Stop intellectual property from infringing on me
teknomage1 is offline   Reply With Quote