[PHP] Array to List

2003-08-14 Thread James Johnson
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

RE: [PHP] Array to List

2003-08-14 Thread James Johnson
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

Re: [PHP] Array to List

2003-08-14 Thread CPT John W. Holmes
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

RE: [PHP] Array to List

2003-08-14 Thread James Johnson
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

Re: [PHP] Array to List

2003-08-14 Thread Jim Lucas
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'

Re: [PHP] Array to List

2003-08-14 Thread Chris Boget
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

Re: [PHP] Array to List

2003-08-11 Thread Chris Boget
> 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

RE: [PHP] Array to List

2003-08-11 Thread James Johnson
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

RE: [PHP] Array to List

2003-08-11 Thread James Johnson
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]

RE: [PHP] Array to List

2003-08-11 Thread James Johnson
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

Re: [PHP] Array to List

2003-08-11 Thread Curt Zirzow
* 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. >