Hello,
Coming from ColdFusion, this is difficult. CF has an ArrayToList() function.
I can't find anything similar in PHP.
I'm building a list from an array with the following code, but it puts a
trailing "," and I need to remove it.
$campusList = "";
foreach ($_PO
TED]
Sent: Monday, August 11, 2003 11:50 AM
To: James Johnson; [EMAIL PROTECTED]
Subject: Re: [PHP] Array to List
> Coming from ColdFusion, this is difficult. CF has an ArrayToList()
> function. I can't find anything similar in PHP.
implode();
> I'm building a list f
From: "James Johnson" <[EMAIL PROTECTED]>
> Actually, I'm using $campusList for a SQL statement:
>
> SELECT name FROM campuses WHERE inst_id IN ('$campusList');
>
> It wasn't working until I found out that $campusList needs to look like
> '1','2','3'.
>
> $campusList = implode( ', ', $_POST['campu
lto:[EMAIL PROTECTED]
Sent: Monday, August 11, 2003 1:42 PM
To: James Johnson; [EMAIL PROTECTED]
Subject: Re: [PHP] Array to List
Everything is fine in your script up to here:
> $row_GetCampuses = mysql_fetch_assoc($GetCampuses);
The above is getting just one (1) record from the database. If you
on page one do this instead.
Jim Lucas
- Original Message -
From: "James Johnson" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, August 11, 2003 1:29 PM
Subject: RE: [PHP] Array to List
> All,
>
> Thanks for your help, but this shouldn'
Everything is fine in your script up to here:
> $row_GetCampuses = mysql_fetch_assoc($GetCampuses);
The above is getting just one (1) record from the database. If you
ever have only one, you are good to go.
> $totalRows_GetCampuses = mysql_num_rows($GetCampuses);
I'm not sure what you are doin
> Coming from ColdFusion, this is difficult. CF has an ArrayToList() function.
> I can't find anything similar in PHP.
implode();
> I'm building a list from an array with the following code, but it puts a
> trailing "," and I need to remove it.
[snip]
$campusList = implode( ', ', $_POST['campus
d it to "SELECT name..."
James
-Original Message-
From: Jim Lucas [mailto:[EMAIL PROTECTED]
Sent: Monday, August 11, 2003 1:32 PM
To: James Johnson; [EMAIL PROTECTED]
Subject: Re: [PHP] Array to List
on page one do this instead.
Jim Lucas
- Original Message -
From
27;m going about this the wrong way. Any advice or suggestions would
be appreciated.
Thanks,
James
-Original Message-
From: CPT John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Monday, August 11, 2003 1:12 PM
To: James Johnson; 'Chris Boget'; [EMAIL PROTECTED]
Subject: Re: [PHP]
Chris, thanks that works perfectly
-Original Message-
From: Chris Boget [mailto:[EMAIL PROTECTED]
Sent: Monday, August 11, 2003 11:50 AM
To: James Johnson; [EMAIL PROTECTED]
Subject: Re: [PHP] Array to List
> Coming from ColdFusion, this is difficult. CF has an ArrayToL
* Thus wrote James Johnson ([EMAIL PROTECTED]):
> Hello,
>
> Coming from ColdFusion, this is difficult. CF has an ArrayToList() function.
> I can't find anything similar in PHP.
>
> I'm building a list from an array with the following code, but it puts a
> trailing "," and I need to remove it.
>
11 matches
Mail list logo