RE: [PHP] Help with multidimensional array setting up a mysql query..
| From: | Jason Wong | Date: | Wed, 16 Aug 2000 02:52:30 +0000 |
| Subject: | RE: [PHP] Help with multidimensional array setting up a mysql query.. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-11902@lists.php.net to get a copy of this message | ||
Chad
you can use something like this:
$subquery = substr($subquery, 0, -1);
which just chops off the last character from the string.
rgds
-
Jason Wong
Digital View Ltd
2201 Nanyang Plaza
57 Hung To Road
Kwun Tong
HONG KONG
Tel: +852-2861-3615
Fax: +852-2520-2987
www.digitalview.com
> -----Original Message-----
> From: Chad Day [mailto:cday@beachassociates.com]
> Sent: 15 August 2000 22:47
> To: 'php-general@lists.php.net'
> Subject: [PHP] Help with multidimensional array setting up a mysql
> query..
> The problem is that the statements are printing out like:
>
> SELECT ABEPN, CABEPN, DESCRIPTION, QUANTITY, PRICE, from abeparts where
> ABEPN like PARTNUM
> SELECT GUDENPN, CGUDENPN, DESCRIPTION, PRICE, from gudenparts
> where GUDENPN
> like PARTNUM
>
> which is REALLY CLOSE to what I want. The problem is the last array
> element, (PRICE).. it adds the comma after it, which I
> understand why it
> does. I just don't know how to write something to say "Hey,
> this is the
> last element in the array, so $subquery .= " $val", not $subquery .= "
> $val,".
>
> I tried to get a count or sizeof the array, and I could loop
> based on that
> easily, but for some reason I can't seem to obtain the count/sizeof my
> multidimensonal arrays correctly. Can anyone help?
>
> Thanks,
> Chad
>
>
> Chad Day
> Beach Associates
>
> When I speak german... I think german in my head... but
> like...Do skript
> kiddies see a w40l3 8uncha 1's and 0's and 3's and 4's and 7's in
> their
> h34d'5 w43n t43y R +a1k1n6 ? -- SirStanley
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>