[PHP] Problem with array

2002-04-30 Thread Carlos Fernando Scheidecker Antunes
Hello All, I've got a form that creates checkboxes based on the number of rows on a table. The user has to check some of the boxes and then click submit. The boxes are named RG1, RG2, RG3, If there are 4 checkboxes and the user selects them all or selects the first, second and fourth, or

[PHP] problem with array

2007-07-15 Thread Ross
I am using postcode anywhere for a 'where's my nearest' function. All the geographical info is contained in an array, which when dumped looks like this var_dump ($result); array(1) { [0]=> array(13) { ["origin_postcode"]=> string(7) "EH2 2BE" ["destination_postcode"]=> string(6) "EH2 2BE" ["di

[PHP] Problem with array

2005-05-01 Thread Murray @ PlanetThoughtful
Hi All, I have 2 function, 1 which calls another, that I am attempting to use in a page with, currently, some problems. In essence, I have a hierarchical recordset table called tbl_content (contid and parid, where parid contains the contid of the record to which the current record belongs).

[PHP] Problem with array

2005-06-16 Thread Ross
As with my previous post the problem is the pieces of the array can vary from 1 to 4 items. So pieces 3 and 4 are often undefined giving the 'undefined index' notice. All I really want to do is display the array pieces if they EXIST. But as they are inside a echo statement so I can't even to a

[PHP] Problem with array

2004-12-15 Thread Ahmed Abdel-Aliem
Hi i am retrieving records from database and putting each row in a array here is the code @ $db = mysql_connect ($server, $user, $pass); mysql_select_db($database); $query = "SELECT Game_ID FROM games WHERE Game_Category='$Game_Category'"; $result= mysql_query($query); $total_numbers = mysql_num_r

[PHP] problem with array

2004-10-14 Thread Dale Hersowitz
Hi guys, Recently, I had to reformat one of the web servers and now I have encountered an unusual problem. I am not sure whether this is an issue which can be fixed in the .ini file or whether its specific to the version of php I am using. Here is the problem: $query="SELECT * FROM customizeVie

Re: [PHP] Problem with array

2002-04-30 Thread Richard Emery
show the form. - Original Message - From: Carlos Fernando Scheidecker Antunes <[EMAIL PROTECTED]> To: PHP-GENERAL <[EMAIL PROTECTED]> Sent: Tuesday, April 30, 2002 10:11 AM Subject: [PHP] Problem with array Hello All, I've got a form that creates checkboxes based

Re: [PHP] problem with array

2007-07-15 Thread Jim Lucas
Ross wrote: I am using postcode anywhere for a 'where's my nearest' function. All the geographical info is contained in an array, which when dumped looks like this var_dump ($result); array(1) { [0]=> array(13) { ["origin_postcode"]=> string(7) "EH2 2BE" ["destination_postcode"]=> string(6)

Re: [PHP] Problem with array

2005-05-01 Thread Richard Lynch
On Sun, May 1, 2005 10:21 am, Murray @ PlanetThoughtful said: > > function listProjectChildren($contid, $list=''){ > > if ($contid<>''){ > > $arrtree = array(); > > $arrtree = buildProjectTree($contid, $level=1); > >

RE: [PHP] Problem with array

2005-05-01 Thread Murray @ PlanetThoughtful
m: Richard Lynch [mailto:[EMAIL PROTECTED] > Sent: Monday, 2 May 2005 5:04 AM > To: Murray @ PlanetThoughtful > Cc: php-general@lists.php.net > Subject: Re: [PHP] Problem with array > > On Sun, May 1, 2005 10:21 am, Murray @ PlanetThoughtful said: > > > [Here there be snippag

RE: [PHP] Problem with array

2005-05-01 Thread Richard Lynch
On Sun, May 1, 2005 1:08 pm, Murray @ PlanetThoughtful said: > Color me confused. I removed "global $arrtree;" and added "$arrtree = > array();" to the function buildProjectTree() and now the parent function > (listProjectChildren) returns no values at all. > > I've checked the page from which list

RE: [PHP] Problem with array

2005-05-01 Thread Murray @ PlanetThoughtful
> -Original Message- > From: Richard Lynch [mailto:[EMAIL PROTECTED] > Sent: Monday, 2 May 2005 6:16 AM > To: Murray @ PlanetThoughtful > Cc: php-general@lists.php.net > Subject: RE: [PHP] Problem with array > > On Sun, May 1, 2005 1:08 pm, Murray @ PlanetThoug

RE: [PHP] Problem with array

2005-05-01 Thread Richard Lynch
On Sun, May 1, 2005 1:46 pm, Murray @ PlanetThoughtful said: >> -Original Message- >> From: Richard Lynch [mailto:[EMAIL PROTECTED] >> Sent: Monday, 2 May 2005 6:16 AM >> To: Murray @ PlanetThoughtful >> Cc: php-general@lists.php.net >> Subject: RE: [

Re: [PHP] Problem with array

2005-06-16 Thread Rory Browne
Not sure if it works for numeric indices, but maybe you could replace $piece[3] with (array_key_exists(3, $piece) ? $piece[3] : ""). If you want you could abstract that into a function, like function array_access_element($key, $srch_array, $def=""){ return array_key_exists($key, $srch_array) ? $s

Re: [PHP] Problem with array

2005-06-17 Thread Rick Emery
Quoting Ross <[EMAIL PROTECTED]>: As with my previous post the problem is the pieces of the array can vary from 1 to 4 items. So pieces 3 and 4 are often undefined giving the 'undefined index' notice. All I really want to do is display the array pieces if they EXIST. But as they are inside a ech

RE: [PHP] Problem with array

2005-06-17 Thread Leila Lappin
ent: Friday, June 17, 2005 2:30 PM To: php-general@lists.php.net Subject: Re: [PHP] Problem with array Quoting Ross <[EMAIL PROTECTED]>: > As with my previous post the problem is the pieces of the array can vary > from 1 to 4 items. So pieces 3 and 4 are often undefined giving the >

Re: [PHP] Problem with array

2004-12-15 Thread Jason Wong
On Thursday 16 December 2004 13:33, Ahmed Abdel-Aliem wrote: Put this at the beginning of all your code: error_reporting(E_ALL); ini_set('display_errors', TRUE); Then run your code to see all the errors and warnings and notices that it generates. Then incorporate the changes below: > i

Re: [PHP] problem with array

2004-10-14 Thread Jason Wong
On Friday 15 October 2004 09:58, Dale Hersowitz wrote: > For some reason, on the last row, I am not unable to reference a particular > index in the array using a php variable. This has been working for almost > 12 months and now the coding is breaking all over the place. I don't have > an answer.

Re: [PHP] problem with array

2004-10-14 Thread Minuk Choi
'b'] = 2; $row['c'] = 1; You can see that your approach is incorrect because what would $row[1] return? If this is NOT your question, please post your output(errors and all). - Original Message - From: "Dale Hersowitz" <[EMAIL PROTECTED]> To: <[EMAIL

RE: [PHP] problem with array

2004-10-15 Thread Graham Cossey
> Hi guys, > Recently, I had to reformat one of the web servers and now I have > encountered an unusual problem. I am not sure whether this is an > issue which > can be fixed in the .ini file or whether its specific to the > version of php > I am using. > > Here is the problem: >$query="SELECT

Re: [PHP] problem with array

2004-10-19 Thread Minuk Choi
Minuk - Original Message - From: "Dale Hersowitz" <[EMAIL PROTECTED]> To: "'Minuk Choi'" <[EMAIL PROTECTED]> Sent: Tuesday, October 19, 2004 12:38 AM Subject: RE: [PHP] problem with array Minuk, After much searching and asking, I found the an

[PHP] problem with array and session

2002-08-12 Thread Ricky
Hello everybody I'd like to make a page in which the results shown can be bookmarked by clicking a button aside each of them. Actually first it should check if the session is open already ... Then if that item(that comes from a query to a MySQL table) has been registered already, finally it reg

[PHP] PHP problem with array keys / pointers

2006-12-17 Thread julian haffegee
Hi all, I've a problem thats been bothering me for a week now I have an array $animals keys and values like this 1 => cat 2 => dog 3 => mouse 4 => horse I want to be able to access them using either a key or a pointer, however the key/pointer will be a variable without variables, if I want

[PHP] Problem with array variables in forms

2003-02-18 Thread Chris Pudney
G'day, Our web-host just upgraded to PHP v4.2.3 (from v4.1.2) and broke all of our forms that use array variables. It appears that when the URL contains square brackets (i.e. %5B and %5D instead of [ and ]) then PHP doesn't parse the variables correctly. For example,

Re: [PHP] PHP problem with array keys / pointers

2006-12-17 Thread Pintér Tibor
1 => cat 2 => dog 3 => mouse 4 => horse iwfm with array(1=>'cat',2=>'dog',3=>'mouse',4=>'horse'): output: Array ( [1] => cat [2] => dog [3] => mouse [4] => horse ) dog source: 'cat',2=>'dog',3=>'mouse',4=>'horse'); print_r($animals); $x=2; echo $animals[$x]."\n"; ?> t -- PHP Gen

Re: [PHP] PHP problem with array keys / pointers

2006-12-17 Thread Satyam
- Original Message - From: "julian haffegee" <[EMAIL PROTECTED]> To: Sent: Sunday, December 17, 2006 7:31 PM Subject: [PHP] PHP problem with array keys / pointers Hi all, I've a problem thats been bothering me for a week now I have an array $animals keys an

Re: [PHP] PHP problem with array keys / pointers

2006-12-17 Thread Jochem Maas
don't hijack an existing thread. (i.e. don't reply to someone elses' post/reply if your asking a new question. you need to learn to use var_dump(), and if you look at the line of code below you should have everything you need to know about numeric array keys: $a = array(2 => "foo"); $b = array("2

Re: [PHP] PHP problem with array keys / pointers

2006-12-17 Thread julian haffegee
will set the element of ordinal number 0 and key ' 2' to 'dog'. To get that value you would either ask for $array[0] or $array[' 2']. thanks for all the comments so far, i'm not sure you are understanding what I am asking for. My problem is NOT knowing what is in the arrays, but how to ac

Re: [PHP] PHP problem with array keys / pointers

2006-12-17 Thread Robert Cummings
On Sun, 2006-12-17 at 23:19 +, julian haffegee wrote: > > will set the element of ordinal number 0 and key ' 2' to 'dog'. To get > > that value you would either ask for $array[0] or $array[' 2']. > > > thanks for all the comments so far, i'm not sure you are understanding what > I am askin

Re: [PHP] Problem with array variables in forms

2003-02-18 Thread Chris Pudney
G'day, It appears that when the URL contains square brackets (i.e. %5B and %5D instead of [ and ]) then PHP doesn't parse the variables correctly. For example, works (you might need to paste the URL i

[PHP] problem with array diff, need to reindex array according to key

2005-04-26 Thread Angelo Zanetti
HI all, I am using the array_diff function. The problem im having is the array that gets returned. Well here's an example: this is where i assign the values to two different arrays $a[]="0"; $a[]="1"; $a[]="2"; $a[]="3"; $b[]="1"; $b[]="4"; $b[]="0"; $diff = array_diff_assoc($a, $b); then c