You are here: Re: mysql_fetch_array and multitable queries « PHP Programming Language « IT news, forums, messages
Re: mysql_fetch_array and multitable queries

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация