I assume you're getting fields with the same name from pulling data from two or
more tables. Something like "SELECT * FROM TABLE1, TABLE2 WHERE TABLE1.id =
TABLE2.id" or something like that.
At any rate, if you can.. it's always good to name the fields you want to pull
instead of using "SELECT
Just use a column alias in your sql query and reference the alias in your array.
SELECT t1.contactID as 'contactID_1', t2.contactID AS 'contactID_2'
FROM table1 t1, table2 t2 ...rest of query
Then your results data array can be referenced like so:
mydata['contactID_1']
mydata['contactID_2']
Ken
7;; [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] Array question
Well its not exactly what I was looking for but you gave me some ideas,
but still got this small problem:
If I know the value in the array, say for example 49. Then I want to
store the previous and next value in the array? I know the othe
// This is how I would do it. The first question is easily solved by putting
a mathematical
// expression inside the array brackets.
$selectIndex = 50; // The index you're interested in
$selectedValue = yourArray[$select];
$selectedValueMinus2 = yourArray[$select-2];
$selectedValuePlus1 = yourArr
) then like you sad
$dataarray($key+1), that's easy. But the other way
-Original Message-
From: Warren Vail [mailto:[EMAIL PROTECTED]
Sent: den 25 augusti 2003 09:33
To: Disko_kex; [EMAIL PROTECTED]
Subject: RE: [PHP-WIN] Array question
in my experience, using numeric indices to
in my experience, using numeric indices to your array, you can deposit and
reference occurances as follows; however your reference is not a valid
array definition;
[0] => 1 [1] => 2 [2] => 3 ... [99] => 100 (I don't believe these are valid
as a definition)
numeric indices would be defined as fo
gt; -Original Message-
> --> From: Ben O'Neill [mailto:[EMAIL PROTECTED]
> --> Sent: Tuesday, March 04, 2003 5:06 PM
> --> To: [EMAIL PROTECTED]
> --> Subject: Re: [PHP-WIN] ARRAY Question!
> -->
> -->
> --> Using that it would be:
> -->
>
It's a numerical key so $myArray[] = "value"; will work perfectly!
Thanks!
--> -Original Message-
--> From: Ben O'Neill [mailto:[EMAIL PROTECTED]
--> Sent: Tuesday, March 04, 2003 5:06 PM
--> To: [EMAIL PROTECTED]
--> Subject: Re: [PHP-WIN] ARRAY Qu
Using that it would be:
$array_length = count($myArray);
$myArray[$array_length] = $new_data;
As arrays start at 0, and count() returns the number of elements.
- Ben O'Neill
"Chris Kranz" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Something like...
>
> $array_length = count(
Something like...
$array_length = count( $myArray );
$myArray[$array_length + 1] = $new_data;
This what your after? I think there might be a function for this tho,
but I'm a bit thick :p
chris kranz
fatcuban.com
-Original Message-
From: Matt Babineau [mailto:[EMAIL PROTECTED]
Sent:
10 matches
Mail list logo