Posted by Marcel on 10/13/05 17:33
"thehuby" <thehuby@gmail.com> schreef in bericht
news:1129212591.055397.284260@z14g2000cwz.googlegroups.com...
>I have a query that looks at two tables and pulls all the data back:
>
> SELECT * FROM venues, status WHERE status_id = fk_status_id
>
> I then have a class to hold the information I want. To initialise it I
> get the data from the results set as per normal. The issue I have is
> that two fields have the field name 'name'. In SQL terms I would refer
> to them like 'tablename.columnname'. How do I achieve this using a
> mysql fetch array?
>
$SQL = "SELECT tablename.columnname AS name1,tablename2.columnname AS name2
FROM ............";
$RESULT = mysql_query($SQL);
$RECORD = mysql_fetch_array($RESULT)
$name1 = $RECORD['name1'];
$name2 = $RECORD['name2'];
Navigation:
[Reply to this message]
|