mysql_fetch_array() question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Anyone know how I can use two mysql_fetch_array() functions similar
to the code below?  I've tried a few different ways but I keep getting
Resource ID #4.  I need to do this to retrieve an email address from one
table and retrieve details from another.

Cheers for any tips - I'm stumped with this one,

Graeme :)

$query = "SELECT Name, Address FROM users"; 
$query2 = "SELECT EmailAddress From Members";

$result = mysql_query($query);
$result2 = mysql_query($query2);

while($details = mysql_fetch_array($result) and $Email =
mysql_fetch_array($result2))
{
    echo "Name: $details[Name]";
    echo "Address: $details[Address]";
    echo "Email: $Email[EmailAddress]";
}






-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux