PEAR DB Results
| From: | Ralph Guzman | Date: | Wed, 31 Oct 2001 10:07:01 +0000 |
| Subject: | PEAR DB Results | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-72997@lists.php.net to get a copy of this message | ||
I am trying to do a joined query using PEAR DB? My code looks something like
this:
$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.