Re: Query for two fields with the same name
| From: | admin at ensifex dot nl | Date: | Thu, 20 Apr 2006 06:27:37 +0000 |
| Subject: | Re: Query for two fields with the same name | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-234321@lists.php.net to get a copy of this message | ||
Maybe something like this :
$connection = "SELECT t2.id AS idtwo, t1.id AS idone FROM connection AS
t1, pr AS t2 WHERE t1.area_id
= '$gateway_link' AND t1.pr_id = t2.id";
> This is probably a simple question, but I can't seem to find the
> answer online.
>
> I'm using this query:
>
> $connection = "select * from connection, pr WHERE connection.area_id
> = '$gateway_link' and connection.pr_id = pr.id";
>
> Both tables have a field called ID but they have different
> information in them. $row['id'] gets me the one from the table called
> "pr" but I need to call the ID from the table connection.
>
> --
> Kevin Murphy
> Webmaster: Information and Marketing Services
> Western Nevada Community College
> www.wncc.edu
> 775-445-3326
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>