| | |
Getting Field name from a select statement
Thread Solved |
Is it possible to get the columns name from a select statement involving more than two table.
eg
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.
eg
MySQL Syntax (Toggle Plain Text)
SELECT a.field1, a.field2,b.field3,c.field4 FROM a,b,c 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.
•
•
Join Date: Nov 2009
Posts: 141
Reputation:
Solved Threads: 16
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.
•
•
Join Date: Dec 2007
Posts: 147
Reputation:
Solved Threads: 27
0
#4 Dec 6th, 2009
refer to the first example at:
http://us3.php.net/manual/en/functio...etch-field.php
http://us3.php.net/manual/en/functio...etch-field.php
![]() |
Similar Threads
- help with mysql SELECT statement (MySQL)
- need help with select statement (VB.NET)
- Need help with mysql select statement and checkboxes (PHP)
- SELECT Statement HELP (PHP)
- Hi,Need help on sql select statement structure (MS SQL)
- Question about SELECT statement (MySQL)
- Getting current value in Select Statement (MS SQL)
- Program Problem with a select statement to access Data base (C)
Other Threads in the MySQL Forum
- Previous Thread: SQL Error Maessage when executing INSERT
- Next Thread: mysql_num_rows(): supplied argument is not a valid MySQL result resource Problem
Views: 813 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for MySQL
"use" .db 1 ajax alphabet amazon aws camparingtocolumns cascade cast code convert count count(col) data database delete design distinct ec2 eliminate enter error form generator html images innerjoins insert join keyword keywords matchingcolumns multiple multipletables mysql mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch noob number open operand oracle order parse pdf php print query recursive relationaldatabases relationship relationships remove reorderingcolumns resultset retrieve script search select simpledb sort sql statement string syntax table tree type-conversion update values welsh





