I am trying to do a joined query using PEAR DB? My code looks something like

$sql = "SELECT wwwpages.pid,wwwpages.name,media.pid,media.name FROM
wwwpages, media WHERE wwwpages.pid = '$pid'";

if(DB::isError($result = $db->query($sql))){
echo "ERROR:" . DB::errorMessage($result);
} else {

while($row = $result->fetchRow(DB_FETCHMODE_ASSOC)){
echo $row[wwwpages.name];
echo $row[media.name]

When I specify '$row[wwwpages.name]' I get a blank result, and if I try
'$row[name]',  I am obviously not specifying a table therefore it results in
name for wwwpages table. How do I go about displaying both?

Thanks in advance.

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to