[PHP-DB] Select query with Forein key Relation

2008-04-23 Thread Nasreen Laghari
Hi, I have a table which contains 2 foreign key relation columns. I'm trying to get all columns from main table as well as all column from those 2 foreign key relation tables. The query i'm using is : select * from gig where gig.gigid = $gigDetail LEFT JOIN genre ON

Re: [PHP-DB] Select query with Forein key Relation

2008-04-23 Thread Evert Lammerts
SELECT * FROM gig LEFT JOIN genre ON gig.genreId = genre.genreId LEFT JOIN venue ON gig.venueID = venue.vid WHERE gig.gigid = $gigdetail I'd replace the dash with [table].[columnames]. Also, you're using four different naming conventions in your columns - gigid, genreId, venueID and vid. If I

Re: [PHP-DB] Select query with Forein key Relation

2008-04-23 Thread Evert Lammerts
It'd be consistent to use uniform naming conventions for your columns. E.g., an ID column is called 'id' in every table, and if you use two words in a column name, to separate them either by an underscore or by a capital letter for the second word. In PHP a dot is an append operator - to