Re: [PHP-WIN] Array Question

2007-08-17 Thread tg-php
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

RE: [PHP-WIN] Array Question

2007-08-17 Thread Vandegrift, Ken
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

RE: [PHP-WIN] Array question

2003-08-26 Thread Warren Vail
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

RE: [PHP-WIN] Array question

2003-08-25 Thread Joachim
// 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

RE: [PHP-WIN] Array question

2003-08-25 Thread Disko_kex
) 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

RE: [PHP-WIN] Array question

2003-08-25 Thread Warren Vail
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

Re: [PHP-WIN] ARRAY Question!

2003-03-04 Thread Aidal
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: > --> >

RE: [PHP-WIN] ARRAY Question!

2003-03-04 Thread Matt Babineau
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

Re: [PHP-WIN] ARRAY Question!

2003-03-04 Thread Ben O'Neill
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(

RE: [PHP-WIN] ARRAY Question!

2003-03-04 Thread Chris Kranz
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: