Hi all,
I want to be able to have an array of elements of different types. As an
example: the first element is a boolean, the second is an integer, and the
thirs is a string.
In php there is no typing, i'm just wondering if there is a way to have that,
it would be a lot better than having an
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 doing
PROTECTED]
Sent: Monday, August 11, 2003 1:29 PM
Subject: RE: [PHP] Array to List
All,
Thanks for your help, but this shouldn't be so freaking hard to do. sigh
1) I have a multiple select input on one page that is populated with a
list
of campuses. The user selects which campus(es) to search on.
2
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['campus'] );
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 ever
have only one, you are good to go
]
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 from an array with the following code, but it puts
a trailing , and I need to remove it.
[snip]
$campusList
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
* 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.
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 ArrayToList()
function
:[EMAIL PROTECTED]
Sent: Monday, August 11, 2003 1:12 PM
To: James Johnson; 'Chris Boget'; [EMAIL PROTECTED]
Subject: Re: [PHP] Array to List
From: James Johnson [EMAIL PROTECTED]
Actually, I'm using $campusList for a SQL statement:
SELECT name FROM campuses WHERE inst_id IN ('$campusList
...
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.
?php
session_start();
if(isset($_POST['Submit'])) {
$_SESSION
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'] );
12 matches
Mail list logo