Re: mysql_fetch_array
| From: | biorn at ebmstpa dot com | Date: | Fri, 28 Sep 2001 14:16:11 +0000 |
| Subject: | Re: mysql_fetch_array | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-12819@lists.php.net to get a copy of this message | ||
Unless it is a typo, you are assigning d.price to both dprice and pprice in
your code. You need to assign p.price to pprice and d.price to dprice.
its me <fotna@egypt.net> said:
> i tried to solve my problem:
>
>
>
> $result=mysql_query("select p.price,
> d.price as dprice, d.price as pprice
> from printers p,desktops d
> where d.companyname='$valcompanyname'
> and d.companyname=p.companyname");
> while($row = mysql_fetch_array($result)) {
> echo $row["pprice"]."<BR>";
> echo $row["dprice"]."<BR>";
>
> }
>
>
> and i got:
>
> 1.00
> 1.00
> 1.00
> 1.00
> 787.00
> 787.00
> 787.00
> 787.00
> 10000000000.00
> 10000000000.00
> 10000000000.00
> 10000000000.00
>
>
> and these 3 numbers are in the desktops table and it ignore completely the
> printers table!!!!
>
>
>
>
> ------------------------------------------------------------
> ------------------------------------------------------------
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
--