Re: [PHP] array question

2010-12-20 Thread Ravi Gehlot
Jim Lucas has it. You can use the preg_match function to find it. I would use regexp for that reason. regexp is good for making sure things are typed the way they need to (mostly used for). Ravi. On Sat, Dec 18, 2010 at 5:17 PM, Jim Lucas li...@cmsws.com wrote: On 12/17/2010 12:52 PM, Sorin

Re: [PHP] array question

2010-12-18 Thread Jim Lucas
On 12/17/2010 12:52 PM, Sorin Buturugeanu wrote: Hello all! I have a question regarding arrays and the way I can use a value. Let's say I have this string: $s = 'banana,apple,mellon,grape,nut,orange' I want to explode it, and get the third value. For this I would normally do: $a =

[PHP] array question

2010-12-17 Thread Sorin Buturugeanu
Hello all! I have a question regarding arrays and the way I can use a value. Let's say I have this string: $s = 'banana,apple,mellon,grape,nut,orange' I want to explode it, and get the third value. For this I would normally do: $a = explode(',', $s); echo $s[2]; That's all fine, but is there

RE: [PHP] array question

2010-12-17 Thread Jay Blanchard
[snip] I have a question regarding arrays and the way I can use a value. Let's say I have this string: $s = 'banana,apple,mellon,grape,nut,orange' I want to explode it, and get the third value. For this I would normally do: $a = explode(',', $s); echo $s[2]; That's all fine, but is there a

Re: [PHP] array question

2010-12-17 Thread Daniel Brown
On Fri, Dec 17, 2010 at 15:52, Sorin Buturugeanu m...@soin.ro wrote: Hello all! I have a question regarding arrays and the way I can use a value. Let's say I have this string: $s = 'banana,apple,mellon,grape,nut,orange' I want to explode it, and get the third value. For this I would

Re: [PHP] array question

2010-12-17 Thread Sorin Buturugeanu
Tanks for all of your responses! I guess a function is the way to go. I just have to see if the situation comes up enough times to justify the function approach. @Dan: I really enjoyed your disclaimer :D -- Sorin Buturugeanu www.soin.ro http://www.facebook.com/buturugeanu

Re: [PHP] Array question

2010-09-26 Thread a...@ashleysheridan.co.uk
was explicitly created, php made the next one at 3. Thanks, Ash http://www.ashleysheridan.co.uk - Reply message - From: chris h chris...@gmail.com Date: Sat, Sep 25, 2010 22:05 Subject: [PHP] Array question To: MikeB mpbr...@gmail.com Cc: php-general@lists.php.net Mike, $results

Re: [PHP] Array question

2010-09-26 Thread tedd
At 3:31 PM -0500 9/25/10, MikeB wrote: -snip- My question, in the loop, why does tha author use: $results[] = mysql_fetch_array($result); instead of (as I would expect): $results[$j] = mysql_fetch_array($result);? What PHP magic is at work here? Mike: That's just a shorthand way to

[PHP] Array question

2010-09-25 Thread MikeB
I have the following code: $query = SELECT * FROM classics; $result = mysql_query($query); if (!$result) die (Database access failed: . mysql_error()); $rows = mysql_num_rows($result); for ($j = 0 ; $j $rows ; ++$j) { $results[] = mysql_fetch_array($result); } mysql_close($db_server);

Re: [PHP] Array question

2010-09-25 Thread chris h
Mike, $results[] will automatically push a value unto the end of an array. So doing this... -- $magic = array(); $magic[] = 'a'; $magic[] = 'b'; $magic[] = 'c'; - is exactly this same as doing this... -- $normal = array(); $normal[0] = 'a'; $normal[1] = 'b'; $normal[2] = 'c'; -

Re: [PHP] Array Question

2007-07-17 Thread kvigor
Thanks for all the input. You've all been pretty informative. Sorry of delayed response to help but was busy. You all are appreciated. Stut [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Richard Lynch wrote: On Wed, July 11, 2007 4:16 pm, Robert Cummings wrote: But I'd have to

Re: [PHP] Array Question

2007-07-14 Thread Robert Cummings
On Sat, 2007-07-14 at 00:55 -0500, Richard Lynch wrote: On Fri, July 13, 2007 2:15 am, Richard Lynch wrote: On Thu, July 12, 2007 8:29 am, Robert Cummings wrote: Hmmm, I thought using an explicit cast was very self explanatory -- especially when the name of the cast is array. Maybe I'm

Re: [PHP] Array Question

2007-07-13 Thread Richard Lynch
On Thu, July 12, 2007 8:29 am, Robert Cummings wrote: Hmmm, I thought using an explicit cast was very self explanatory -- especially when the name of the cast is array. Maybe I'm alone in that thought. I mean if you convert a scalar to an array what do you expect to get? An array with the

Re: [PHP] Array Question

2007-07-13 Thread Robert Cummings
On Fri, 2007-07-13 at 02:15 -0500, Richard Lynch wrote: On Thu, July 12, 2007 8:29 am, Robert Cummings wrote: Hmmm, I thought using an explicit cast was very self explanatory -- especially when the name of the cast is array. Maybe I'm alone in that thought. I mean if you convert a scalar

Re: [PHP] Array Question

2007-07-13 Thread Richard Lynch
On Fri, July 13, 2007 2:15 am, Richard Lynch wrote: On Thu, July 12, 2007 8:29 am, Robert Cummings wrote: Hmmm, I thought using an explicit cast was very self explanatory -- especially when the name of the cast is array. Maybe I'm alone in that thought. I mean if you convert a scalar to an

Re: [PHP] Array Question

2007-07-12 Thread Stut
Richard Lynch wrote: On Wed, July 11, 2007 4:16 pm, Robert Cummings wrote: But I'd have to say that the intent is not all that clear, really, and I'd be leery of this feature, personally. I wouldn't be leery at all. It's been around for a very long time and it's documented:

Re: [PHP] Array Question

2007-07-12 Thread Robert Cummings
On Thu, 2007-07-12 at 09:58 +0100, Stut wrote: Richard Lynch wrote: On Wed, July 11, 2007 4:16 pm, Robert Cummings wrote: But I'd have to say that the intent is not all that clear, really, and I'd be leery of this feature, personally. I wouldn't be leery at all. It's been around for a

[PHP] Array Question

2007-07-11 Thread kvigor
Is there a php function similar to in_array that can detect if a partial value is in an array value or not: e.g. $var1 = big horse;$var2 = small yellow;$var3 = red hydrant; $theArray = array(big blue horse, small yellow bird, giant red hydrant); Is there a way to find out if $var1

Re: [PHP] Array Question

2007-07-11 Thread Robin Vickery
On 11/07/07, kvigor [EMAIL PROTECTED] wrote: Is there a php function similar to in_array that can detect if a partial value is in an array value or not: e.g. $var1 = big horse;$var2 = small yellow;$var3 = red hydrant; $theArray = array(big blue horse, small yellow bird, giant red

Re: [PHP] Array Question

2007-07-11 Thread kvigor
Thanks, I've seen the light by your code. Robin Vickery [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On 11/07/07, kvigor [EMAIL PROTECTED] wrote: Is there a php function similar to in_array that can detect if a partial value is in an array value or not: e.g. $var1 = big

Re: [PHP] Array Question

2007-07-11 Thread Robert Cummings
On Wed, 2007-07-11 at 09:46 +0100, Robin Vickery wrote: On 11/07/07, kvigor [EMAIL PROTECTED] wrote: Is there a php function similar to in_array that can detect if a partial value is in an array value or not: e.g. $var1 = big horse;$var2 = small yellow;$var3 = red hydrant;

Re: [PHP] Array Question

2007-07-11 Thread Stut
Robert Cummings wrote: On Wed, 2007-07-11 at 09:46 +0100, Robin Vickery wrote: On 11/07/07, kvigor [EMAIL PROTECTED] wrote: Is there a php function similar to in_array that can detect if a partial value is in an array value or not: e.g. $var1 = big horse;$var2 = small yellow;$var3

Re: [PHP] Array Question

2007-07-11 Thread Robert Cummings
On Wed, 2007-07-11 at 15:52 +0100, Stut wrote: Robert Cummings wrote: On Wed, 2007-07-11 at 09:46 +0100, Robin Vickery wrote: On 11/07/07, kvigor [EMAIL PROTECTED] wrote: Is there a php function similar to in_array that can detect if a partial value is in an array value or not: e.g.

Re: [PHP] Array Question

2007-07-11 Thread Stut
Robert Cummings wrote: On Wed, 2007-07-11 at 15:52 +0100, Stut wrote: Robert Cummings wrote: On Wed, 2007-07-11 at 09:46 +0100, Robin Vickery wrote: On 11/07/07, kvigor [EMAIL PROTECTED] wrote: Is there a php function similar to in_array that can detect if a partial value is in an array

Re: [PHP] Array Question

2007-07-11 Thread Robert Cummings
On Wed, 2007-07-11 at 16:07 +0100, Stut wrote: Robert Cummings wrote: On Wed, 2007-07-11 at 15:52 +0100, Stut wrote: Robert Cummings wrote: On Wed, 2007-07-11 at 09:46 +0100, Robin Vickery wrote: On 11/07/07, kvigor [EMAIL PROTECTED] wrote: Is there a php function similar to in_array

Re: [PHP] Array Question

2007-07-11 Thread Robin Vickery
On 11/07/07, Robert Cummings [EMAIL PROTECTED] wrote: On Wed, 2007-07-11 at 09:46 +0100, Robin Vickery wrote: On 11/07/07, kvigor [EMAIL PROTECTED] wrote: Is there a php function similar to in_array that can detect if a partial value is in an array value or not: e.g. $var1 = big

Re: [PHP] Array Question

2007-07-11 Thread Richard Lynch
On Wed, July 11, 2007 9:52 am, Stut wrote: $needle = (array)$needle; Conversion to array creates an array with one element... the value converted. Without raising a notice? Sure looks like it: php -d error_reporting=2047 -r '$foo = (array) foo; var_dump($foo);' array(1) { [0]=

Re: [PHP] Array Question

2007-07-11 Thread Robert Cummings
On Wed, 2007-07-11 at 16:11 -0500, Richard Lynch wrote: On Wed, July 11, 2007 9:52 am, Stut wrote: $needle = (array)$needle; Conversion to array creates an array with one element... the value converted. Without raising a notice? Sure looks like it: php -d error_reporting=2047

Re: [PHP] Array Question

2007-07-11 Thread Richard Lynch
On Wed, July 11, 2007 4:16 pm, Robert Cummings wrote: But I'd have to say that the intent is not all that clear, really, and I'd be leery of this feature, personally. I wouldn't be leery at all. It's been around for a very long time and it's documented:

Re: [PHP] Array Question

2007-07-11 Thread Robert Cummings
On Wed, 2007-07-11 at 16:40 -0500, Richard Lynch wrote: On Wed, July 11, 2007 4:16 pm, Robert Cummings wrote: But I'd have to say that the intent is not all that clear, really, and I'd be leery of this feature, personally. I wouldn't be leery at all. It's been around for a very long

Re: [PHP] Array Question

2007-03-25 Thread Stut
[EMAIL PROTECTED] wrote: $count=count($data-legs-leg); $k=0; while($k $count) {

[PHP] Array Question

2007-03-24 Thread rluckhurst
Hi All I am having a bit of trouble with PHP arrays and would appreciate some help. I currently have the following piece of code $count=count($data-legs-leg); $k=0; while($k $count) {

RE: [PHP] Array Question

2007-03-24 Thread Jake McHenry
$legrow[$data-legs-leg[$k]['legId']] ?? See if that works... Jake -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Saturday, March 24, 2007 11:27 PM To: php-general@lists.php.net Subject: [PHP] Array Question Hi All I am having a bit of trouble

RE: [PHP] Array Question

2007-03-24 Thread Jake McHenry
] Array Question Hi All I am having a bit of trouble with PHP arrays and would appreciate some help. I currently have the following piece of code $count=count($data-legs-leg); $k=0; while($k $count) { $legrow[$k]=$data-legs-leg[$k

RE: [PHP] Array Question

2007-03-24 Thread rluckhurst
-leg[$k]['legId']] ?? See if that works... Jake -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Saturday, March 24, 2007 11:27 PM To: php-general@lists.php.net Subject: [PHP] Array Question Hi All I am having a bit of trouble with PHP arrays and would

RE: [PHP] Array Question

2007-03-24 Thread rluckhurst
, March 24, 2007 11:27 PM To: php-general@lists.php.net Subject: [PHP] Array Question Hi All I am having a bit of trouble with PHP arrays and would appreciate some help. I currently have the following piece of code $count=count($data-legs-leg); $k=0; while($k $count

RE: [PHP] Array Question

2007-03-24 Thread Jake McHenry
What is the result your getting? Jake -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Saturday, March 24, 2007 11:57 PM To: Jake McHenry Cc: php-general@lists.php.net Subject: RE: [PHP] Array Question Hi Jake I tried that and got the same result

RE: [PHP] Array Question

2007-03-24 Thread rluckhurst
PROTECTED] Sent: Saturday, March 24, 2007 11:27 PM To: php-general@lists.php.net Subject: [PHP] Array Question Hi All I am having a bit of trouble with PHP arrays and would appreciate some help. I currently have the following piece of code $count=count($data-legs-leg); $k=0

RE: [PHP] Array Question

2007-03-24 Thread Jake McHenry
:09 AM To: Jake McHenry Cc: php-general@lists.php.net Subject: RE: [PHP] Array Question Hi Jake I am getting nothing at all. Regards Richard What is the result your getting? Jake -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent

RE: [PHP] Array question

2007-02-27 Thread Ford, Mike
On 27 February 2007 04:23, Gerry D wrote: I have a question on how to retrieve the value that corresponds to a key in an array. $fruit = array('a' = 'apple', 'b' = 'banana', 'c' = 'cranberry'); $key = array_search($c, $fruit); if ( $key === FALSE )

Re: [PHP] Array question

2007-02-27 Thread Gerry D
Mike, See entire function under topic Array question - maybe UTF?... I am trying to change accented characters to their equivalent without accents. And yes, the arrays look fine after var_dump()... Gerry On 2/27/07, Ford, Mike [EMAIL PROTECTED] wrote: On 27 February 2007 04:23, Gerry D

[PHP] Array question

2007-02-26 Thread Gerry D
I have a question on how to retrieve the value that corresponds to a key in an array. $fruit = array('a' = 'apple', 'b' = 'banana', 'c' = 'cranberry'); $key = array_search($c, $fruit); if ( $key === FALSE ) $n = $c; else

[PHP] Array Question

2006-03-29 Thread cybermalandro cybermalandro
So, I have an array that looks like this rray(3) { [0]= array(8) { [line]= string(1) 1 [ponbr]= string(5) 34474 [emt]= string(3) yes [qty]= string(1) 5 [price]= string(2) 19 [shipdate]= string(8) 11/06/07 [tracking]= string(17)

[PHP] Array Question again

2006-03-29 Thread cybermalandro cybermalandro
Let me try this again. I want to take an array that may look like this array(2) { [0]= array(8) { [line]= string(1) 1 [ponbr]= string(5) TEST1 [emt]= string(3) yes [qty]= string(1) 5 [price]= string(2) 19 [shipdate]= string(8) 12/04/06

[PHP] array question: fixed

2005-09-13 Thread matt VanDeWalle
hey, thanks for jogging my memory about the array_keys ; that was exactly what i wanted, now I don't have to run the program through the more program now, and i got all the names of the arrays in the big array without having half of the info scrolling off the screen. thanks matt -- PHP

[PHP] PHP Array question

2005-02-15 Thread R. Van Tassel
I have an array with image names like: $arrayone = array(1.jpg, 2.jpg); $arraytwo = array(a.jpg, b.jpg); Then I have a variable for each to count the number of elements: $arrayoneElements = count($arrayone); $arraytwoElements = count($arraytwo); I'm using the element

Re: [PHP] PHP Array question

2005-02-15 Thread Matt M.
What I want to do is to only show 20 pictures at a time with a Next link and a Previous link. For the first 20 only the Next link would show and whenever the last set would show only the Previous link would. Every other time both would show. Can someone point me in the right direction on

[PHP] php array question

2004-11-01 Thread Victor C.
Hi, I have a line of php that I don't really understand. foreach($this-orders as $OrderID = $value) { echo $OrderID.BR; $OrderObject =$this-orders[$OrderID=$value]; echo $OrderObject-OrderID.--all the sameBR; } I know that $this-orders is an array of order objects. the result i get

[PHP] Re: php array question

2004-11-01 Thread Ben Ramsey
Victor C. wrote: $OrderObject =$this-orders[$OrderID=$value]; This line is confusing. $OrderID=$value is either a typo or is just plain wrong. It looks like what it's meant to say is: $OrderObject = $this-orders[$OrderID]; But this will just set $OrderObject equal to $value, so you should

[PHP] Re: php array question

2004-11-01 Thread Victor C.
But why would the this line generate different OrderID on lines 1 and 3? Ben Ramsey [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Victor C. wrote: $OrderObject =$this-orders[$OrderID=$value]; This line is confusing. $OrderID=$value is either a typo or is just plain wrong. It

[PHP] Re: php array question

2004-11-01 Thread Ben Ramsey
Ben Ramsey wrote: Victor C. wrote: $OrderObject =$this-orders[$OrderID=$value]; This line is confusing. $OrderID=$value is either a typo or is just plain wrong. It looks like what it's meant to say is: $OrderObject = $this-orders[$OrderID]; But this will just set $OrderObject equal to

[PHP] Re: php array question

2004-11-01 Thread Victor C.
I did a print_r(array_values)before calling the codes that had errors in it.. the following content is contained in $this-orders; Array ( [0] = order Object ( [UserObject] = user Object ( [UserID] = E2401 [Pass] = [IsValid] = 1 [UserType] = AT [fonthtml] = [footerfile] = resources/footer.php

[PHP] Re: php array question

2004-11-01 Thread Ben Ramsey
Victor C. wrote: I did a print_r(array_values)before calling the codes that had errors in it.. the following content is contained in $this-orders; Aaaghh. Can you give that to us in pre-formatted text, rather than copying and pasting it from the browser. My eyes are going everywhere trying

[PHP] Re: php array question

2004-11-01 Thread Victor C.
Hi Ben, I tried your portion of code and find out what was wrong... Apparently I used in adding order to the array and that was messing things up... Everything is working now. Thanks for all the help Victor C. [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I did a

RE: [PHP] php array question

2004-11-01 Thread Zareef Ahmed
-Original Message- From: Victor C. [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 02, 2004 3:06 AM To: [EMAIL PROTECTED] Subject: [PHP] php array question Hi, I have a line of php that I don't really understand. foreach($this-orders as $OrderID = $value) { echo $OrderID.BR; I

[PHP] Array Question

2004-05-02 Thread Jason Williard
I am using the following array and function in the template for my website. It works great, but I want to to be better. I would to make it so the last item displayed looks differently than the others, but I have been unable to figure out how to distinguish the last item. When displayed, the

[PHP] Array Question

2004-02-28 Thread Jason Williard
I would like to be able to search an array for a match the a specific variable. So far, I have been trying to use preg_grep but am not getting the results that I want. Basically, I would have a variable: $url = domain.com I would like to search an array to see if the value of the variable $url

Re: [PHP] Array Question

2004-02-28 Thread Michal Migurski
I would like to search an array to see if the value of the variable $url exists in this array. The array would look like: in_array() - michal migurski- contact info and pgp key: sf/ca

[PHP] Array question

2003-09-27 Thread Robin Kopetzky
Good morning all!! Can you nest an array within an array?? Example: $paArgs['aCheckBoxes[$iIndex]['sName']'] Thank you in advance. Robin 'Sparky' Kopetzky Black Mesa Computers/Internet Service Grants, NM 87020 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Array question

2003-09-27 Thread Robert Cummings
On Sat, 2003-09-27 at 12:18, Robin Kopetzky wrote: Good morning all!! Can you nest an array within an array?? Example: $paArgs['aCheckBoxes[$iIndex]['sName']'] You mean can you retrieve an array entry by giving a key defined by a value in another array? To do so remove the outer quotes in

Re: [PHP] Array question

2003-09-27 Thread Jackson Miller
On Saturday 27 September 2003 11:18, Robin Kopetzky wrote: Good morning all!! Can you nest an array within an array?? Example: $paArgs['aCheckBoxes[$iIndex]['sName']'] Yes, but like this $array['aCheckBoxes'][] = $iIndex['sName'] This means: $array is an array aCheckBoxes is a item in

Re: [PHP] Array question

2003-09-27 Thread Cristian Lavaque
http://www.php.net/manual/en/language.types.array.php If you mean having an array inside an array, of course ? $arr = array(array('data')); ?. There you have an array inside another one, 'data' will be here $var['0']['0']. If you meant using an array item as the key in another array, then you do

[PHP] Array Question

2003-07-28 Thread Pushpinder Singh Garcha
hello everyone, I am trying to store one of the fields of the resultset into an array as I display the results. while ($row = mysql_fetch_array($result1)) { // Alternate the bgcolor of each row for visibility ($even % 2) == 0 ? $bgcolor = #EFEFEF : $bgcolor = #ee;

Re: [PHP] Array Question

2003-07-28 Thread Jim Lucas
Try this. $companyname[] = $row['company']; Jim Lucas - Original Message - From: Pushpinder Singh Garcha [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 28, 2003 10:16 AM Subject: [PHP] Array Question hello everyone, I am trying to store one of the fields

[PHP] ARRAY QUESTION

2003-07-24 Thread Dale Hersh
I have a question regarding the count function. Here goes: Lets pretend I have this array called myStuff. If I add two elements to myStuff and call the count function, I will get a result of 2. My question is how do I re-initialize the array after adding elements so when I call the count function

RE: [PHP] ARRAY QUESTION

2003-07-24 Thread Jay Blanchard
[snip] Lets pretend I have this array called myStuff. If I add two elements to myStuff and call the count function, I will get a result of 2. My question is how do I re-initialize the array after adding elements so when I call the count function on the array, I get a result of 0. [/snip] If you

RE: [PHP] ARRAY QUESTION

2003-07-24 Thread Chris W. Parker
Dale Hersh mailto:[EMAIL PROTECTED] on Thursday, July 24, 2003 12:41 PM said: Lets pretend I have this array called myStuff. If I add two elements to myStuff and call the count function, I will get a result of 2. My question is how do I re-initialize the array after adding elements so

Re: [PHP] ARRAY QUESTION

2003-07-24 Thread Curt Zirzow
* Thus wrote Dale Hersh ([EMAIL PROTECTED]): I have a question regarding the count function. Here goes: Lets pretend I have this array called myStuff. If I add two elements to myStuff and call the count function, I will get a result of 2. My question is how do I re-initialize the array after

[PHP] array question

2003-05-30 Thread Randy Johnson
How do I access the data in $query_data after I go through the while loop, here is an example $result=mysql_query($query,$link); while ($query_data=mysql_fetch_array($result) ) { $var1=$query_data[var1]; $var1=$query_data[var1]; } after the while is done, How do I access the data in

Re: [PHP] array question

2003-05-30 Thread Randy Johnson
I found this in the manual user comments and it worked great mysql_data_seek($result,0); Randy - Original Message - From: Randy Johnson [EMAIL PROTECTED] To: Brian Dunning [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, May 29, 2003 10:14 PM Subject: [PHP] array question How do

[PHP] Array Question

2003-04-01 Thread Mark McCulligh
I have two tables that I want to display together as if they were one table and order them by a common date field. Because I am using MySQL I can't use the usually way I would do this. Create a store procedure or view. I was thinking of creating two separate queries in PHP then loading the data

Re: [PHP] Array Question

2003-04-01 Thread skate
look into things like JOIN and SORT BY in MySQL, they're quicker and more efficient than PHP for doing DB stuff (so i'm told) took me awhile to get my head around JOIN, but once you've got it, you'll never be without it ;) Mark McCulligh [EMAIL PROTECTED] wrote in message news:[EMAIL

Re: [PHP] Array Question

2003-04-01 Thread Chris Hayes
At 18:58 1-4-03, you wrote: I have two tables that I want to display together as if they were one table and order them by a common date field. Because I am using MySQL I can't use the usually way I would do this. Create a store procedure or view. Does every row in tableA has a sibling row in

Re: [PHP] Array Question

2003-04-01 Thread Mark McCulligh
I can't link the two tables at all. I need to loop through one displaying its information, then loop through the other table displaying its information. For if I have 5 records in table A and 6 records in table B, I get 11 records total. Each table only has 4-5 fields and they exist in both

Re: [PHP] Array Question

2003-04-01 Thread Mark McCulligh
I have looked at the different JOINs but I can't link any fields together. There is no relationship between the tables. The two table are basically the same table. But the DBA didn't make them one like he should have. Mark. Skate [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] look

Re: [PHP] Array Question

2003-04-01 Thread Tim Burden
. http://www.mysql.com/doc/en/MERGE.html - Original Message - From: Mark McCulligh [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Tuesday, April 01, 2003 12:33 PM Subject: Re: [PHP] Array Question I have looked at the different JOINs but I can't link any fields

Re: [PHP] Array Question

2003-04-01 Thread Rob Adams
Creating an array that holds the 11 combined records from the two tables, and sorting the array according to date: (This depends on what type your using to store dates in MySQL, and that the exact date is unique for each record across both tables. If the date isn't unique, it requires a little

[PHP] array question

2003-03-10 Thread Diana Castillo
If I sort an array, and now the keys are not in numerical order, how can I get the key of the first element? If I do array_shift I get the first element but I want that key. Thanks, Diana -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] array question

2003-03-10 Thread Jason Wong
On Monday 10 March 2003 21:13, Diana Castillo wrote: If I sort an array, and now the keys are not in numerical order, how can I get the key of the first element? If I do array_shift I get the first element but I want that key. Not very elegant -- there must be a better way? foreach ($doo as

Re: [PHP] array question

2003-03-10 Thread Ernest E Vogelsinger
At 16:35 10.03.2003, Jason Wong said: [snip] Not very elegant -- there must be a better way? foreach ($doo as $key = $value) { print Key:$key Value:$value; break; } [snip] Possibly using array_keys()? $keys =

RE: [PHP] array question

2003-03-10 Thread Ford, Mike [LSS]
-Original Message- From: Jason Wong [mailto:[EMAIL PROTECTED] Sent: 10 March 2003 15:35 To: [EMAIL PROTECTED] Subject: Re: [PHP] array question On Monday 10 March 2003 21:13, Diana Castillo wrote: If I sort an array, and now the keys are not in numerical order, how can I

[PHP] array question

2003-02-24 Thread Richard Kurth
This is the code I am using to get the data out of the text file below. Now I need to turn the $group[3] into an array of its own so that I can make changes to it. How do I turn this into an array that I can reference with $group[0]. What I need to be able to do is search for the label in

Re: [PHP] array question

2003-02-24 Thread Chris Edwards
://www.OuterBanksInternet.com - Original Message - From: Richard Kurth [EMAIL PROTECTED] To: php-general [EMAIL PROTECTED] Sent: Monday, February 24, 2003 3:23 PM Subject: [PHP] array question This is the code I am using to get the data out of the text file below. Now I need to turn the $group[3

Re: [PHP] array question

2003-02-24 Thread Bob Irwin
Hi Guys, This might be a bit of a newbie question, but I'm not sure how to search for this particular information as its hard to put in search terms. Say I have a mysql/file with information about variables. Eg, I have a string from a mysql database of 'test' Am I able to then, in PHP, assign

RE: [PHP] array question

2003-02-24 Thread Johnson, Kirk
http://www.php.net/manual/en/language.variables.variable.php Kirk -Original Message- From: Bob Irwin [mailto:[EMAIL PROTECTED] Sent: Monday, February 24, 2003 3:28 PM To: php-general Subject: Re: [PHP] array question Hi Guys, This might be a bit of a newbie question

RE: [PHP] Array Question

2002-10-30 Thread Ford, Mike [LSS]
-Original Message- From: PHP List [mailto:php_list;ibcnetwork.net] Sent: 29 October 2002 17:20 To: php Subject: Re: [PHP] Array Question No, array_keys does not do what I want, in order to user array_keys, it assumes I know the value of the key, but I don't, Er -- no. Go

[PHP] array question

2002-10-30 Thread John Meyer
When retrieving an array from $_POST, which is the right way: $arrInterests = $_POST[interests[]]; or $arrInterests = $_POST[interests]; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] array question

2002-10-30 Thread Rick Emery
What happened when you tried both methods? - Original Message - From: John Meyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 10:29 AM Subject: [PHP] array question When retrieving an array from $_POST, which is the right way: $arrInterests = $_POST

RE: [PHP] array question

2002-10-30 Thread John Meyer
Either way, I'm not getting the interests. -Original Message- From: Rick Emery [mailto:remery;emeryloftus.com] Sent: Wednesday, October 30, 2002 9:34 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] array question What happened when you tried both methods? - Original Message - From

Re: [PHP] array question

2002-10-30 Thread Rick Emery
What does you HTML look like? - Original Message - From: John Meyer [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 10:36 AM Subject: RE: [PHP] array question Either way, I'm not getting the interests. -Original Message- From: Rick Emery [mailto:remery

Re: [PHP] array question

2002-10-30 Thread @ Edwin
Hello, John Meyer [EMAIL PROTECTED] wrote: Either way, I'm not getting the interests. ...[snip]... When retrieving an array from $_POST, which is the right way: $arrInterests = $_POST[interests[]]; or $arrInterests = $_POST[interests]; Try this instead: $arrInterests =

Re: [PHP] array question

2002-10-30 Thread Philip Olson
[EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, October 30, 2002 10:36 AM Subject: RE: [PHP] array question Either way, I'm not getting the interests. -Original Message- From: Rick Emery [mailto:remery;emeryloftus.com] Sent: Wednesday, October 30, 2002 9:34 AM

RE: [PHP] Array Question

2002-10-29 Thread Ford, Mike [LSS]
-Original Message- From: PHP List [mailto:php_list;ibcnetwork.net] Sent: 28 October 2002 22:48 To: php Subject: [PHP] Array Question Hi, Lets say I have a simple array like this: $myarray = array(a=b,d=c); echo $myarray[0] will return 'b'; How can I get the name

Re: [PHP] Array Question

2002-10-29 Thread Brent Baisley
Perhaps you want to look at array_keys(). On Monday, October 28, 2002, at 05:48 PM, PHP List wrote: How can I get the name of the index? -- Brent Baisley Systems Architect Landover Associates, Inc. Search Advisory Services for Advanced Technology Environments p: 212.759.6400/800.759.0577 --

Re: [PHP] Array Question

2002-10-29 Thread PHP List
No, array_keys does not do what I want, in order to user array_keys, it assumes I know the value of the key, but I don't, I want to get the value of the key but all I know is the index. Perhaps you want to look at array_keys(). On Monday, October 28, 2002, at 05:48 PM, PHP List wrote: How

Re: [PHP] Array Question

2002-10-28 Thread PHP List
This doesn't seem to work for anything past the first key: echo array_search(0,$myarray); will print 'a'; None of these give me anything: echo array_search(1,$myarray); echo array_search(1,$myarray); echo array_search(1,$myarray,true); echo array_search(1,$myarray,true); so how do I get 'd'?

[PHP] Array question

2002-08-14 Thread Brad Harriger
I have a program containing an array called $thisArray. At some point in the program, the value of next($thisArray) is an array ($subArray). How can I echo the name of the of the second array (subArray)? The name of the sub array may change at any time, so I can't just hard code it. Thanks

Re: [PHP] Array question

2002-08-14 Thread Bas Jobsen
How can I echo the name of the of the second array (subArray)? The name for value ?php $test=array ( 'a'=array('1','2'.'3'), 'c'=array('6','5'.'4'), 'd'=array('8','9'.'10'),

[PHP] Array question - Finding the name

2002-06-07 Thread Phil Schwarzmann
Let's say I have an array... $my_array[] = array('bob' = $x, 'jim' = $y, 'mike' = $z); Now I want to find the name of the second element in the array (I want my result to be 'jim') How do I do this? I think I might have to use the key() function but I can't quite get it to wkr. Thanks!

Re: [PHP] Array question - Finding the name

2002-06-07 Thread Jason Wong
On Friday 07 June 2002 22:16, Phil Schwarzmann wrote: Let's say I have an array... $my_array[] = array('bob' = $x, 'jim' = $y, 'mike' = $z); you probably meant to define it as: $my_array = array('bob' = $x, 'jim' = $y, 'mike' = $z); use print_r($my_array) to see the difference between

  1   2   >