Reply to Re: Array Association

Your name:

Reply:


Posted by Magzilla on 03/24/06 16:40

Another possible method to solve your problem. I demo it with following
example.

In case you have two tables tableA and table B, both of them have name,
id as table fields.
In stead of using "SELECT tableA.name, tableB.name FROM tableA, tableB
WHERE tableA.id=tableB.id",
You could use: "SELECT tableA.name AS Aname, tableB.name AS Bname
FROM tableA, tableB WHERE tableA.id=tableB.id",

And after your call to $sth=mysql_fetch_assoc(),
You could use $sth["Aname"] to reference to tableA.name. And
$sth["Bname"] to reference to tableB.name.

[Back to original 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

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