Re: NewB PHP / mysql Q
| From: | 1LT John W. Holmes | Date: | Thu, 10 Oct 2002 15:36:17 +0000 |
| Subject: | Re: NewB PHP / mysql Q | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-119546@lists.php.net to get a copy of this message | ||
The problem is that array keys are case sensitive. You can use what you've
got, but the case has to match what you're selecting in your query. I see
you are trying to use $row['UName'] but I don't see you selecting that in
your query.
---John Holmes...
----- Original Message -----
From: "Timothy J Hitchens" <tim@hitcho.com.au>
To: <php-general@lists.php.net>
Sent: Thursday, October 10, 2002 9:33 AM
Subject: RE: [PHP] NewB PHP / mysql Q
> Try this..
>
> select u.id, u.lname as lastname, u.frname as firstname, ... etc
>
> oh and the reason you get an error is that you can't have a dot in a
> variable etc...
>
>
>
> Timothy Hitchens (HITCHO)
> tim@hitcho.com.au
>
> HITCHO has Spoken!
>
>
>
>
>
>
> -----Original Message-----
> From: inpho [mailto:inphorm@gmx.net]
> Sent: Thursday, 10 October 2002 4:19 PM
> To: php-general@lists.php.net
> Subject: [PHP] NewB PHP / mysql Q
>
>
> Hi all,
>
> I need a bit of quick help here....
> I've joined 2 tables together with this code here:
>
> $result=mysql_query("select u.id, u.cid, u.lname, u.fname, u.vld, c.id,
> c.cname from tblclient u, tblcompany c where u.vld=1 and u.cid =
> c.id",$db);
>
> then I put it into an array:
>
> while ($row=mysql_fetch_array($result)) {
> print "<tr><td>$row[UName]</td><td>$row[FName]
> $row[LName]</td>$row[cname]<td></td></tr>";
> }
>
> but the $row[xxx] aren't displaying any info, if I put $row[u.unam] it
> returns an error. I run the SQL query in phpmyadmin and it runs fine,
> returning 2 results how do I access those results through an array???
>
> - inpho -
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>