Getting Field name from a select statement

Please support our MySQL advertiser: 50% off 6 Months Dedicated Server Hosting from 1&1!
Thread Solved

Join Date: Oct 2007
Posts: 21
Reputation: awo is an unknown quantity at this point 
Solved Threads: 1
awo's Avatar
awo awo is offline Offline
Newbie Poster

Getting Field name from a select statement

 
0
  #1
Dec 6th, 2009
Is it possible to get the columns name from a select statement involving more than two table.
eg
  1. SELECT a.field1, a.field2,b.field3,c.field4
  2. FROM a,b,c
  3. WHERE a.field1 = b.field1 AND a.field1 = c.field1

is there a mysql statement that returns a record set containing field1, field2, field3, field4 that can be sent to an array that can be used in a php script.
Last edited by awo; Dec 6th, 2009 at 4:31 am.
Reply With Quote Quick reply to this message  
Join Date: Nov 2009
Posts: 141
Reputation: zortec is an unknown quantity at this point 
Solved Threads: 16
zortec zortec is offline Offline
Junior Poster
 
1
  #2
Dec 6th, 2009
You can use a JOIN to link the two tables together. This link will explain the different types of joins.
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 21
Reputation: awo is an unknown quantity at this point 
Solved Threads: 1
awo's Avatar
awo awo is offline Offline
Newbie Poster
 
0
  #3
Dec 6th, 2009
it is not about the join but how to get the name of the return fields
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 147
Reputation: hielo is on a distinguished road 
Solved Threads: 27
hielo hielo is offline Offline
Junior Poster
 
0
  #4
Dec 6th, 2009
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 813 | Replies: 3
Thread Tools Search this Thread



Tag cloud for MySQL
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC