Based on the snippet you have sent us you need
to at least start by enclosing your column names
in your accesses to the associative array containing
your results.

Each line just use print_r or var_dump:

while($row = $result->fetchRow(DB_FETCHMODE_ASSOC))

This will show you exactly what is going on. Verify
that your results are actually there as well.

As a final note the actual problem appears to
be that you are not accessing the associative
array elements with quotes:

echo $row[""];

Instead of:

echo $row[];

This should show you what is going on and help you
easier determine what is going wrong, it is possible
you are not returning any data with your query as


Jeremy Allen

-----Original Message-----
From: Ralph Guzman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 31, 2001 5:07 AM
To: PHP General Mailing List
Subject: [PHP] PEAR DB Results

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

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

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

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

When I specify '$row[]' 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?

Do You Yahoo!?
Get your free address at

PHP General Mailing List (
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