getting values by a joints mysql query
| From: | Michael P. Carel | Date: | Thu, 20 Jun 2002 03:50:47 +0000 |
| Subject: | getting values by a joints mysql query | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-103070@lists.php.net to get a copy of this message | ||
Hi to all,
Im having problem in getting the the result values in my cross joint query.
Here's my query:
$query=("Select U.Name, U.Title, G.Groups from Users as U, Groups as G where
U.Id='$Id' ");
$result=mysql_query($query);
$data=mysql_fetch_array($result);
$Name= $data[U.Name];
$Title = $data[Title];
$GID = $data[Groups.GID];
print $Name;
print $Title;
print $GID;
I dont have any printed results here. But if i query the two table one by
one i can have the printed result.
Please help!
Regards,
Mike