[PHP] Re: problem with array

2007-07-15 Thread Al
Do a print_r($result); and you'll see the problem. 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]=

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

2005-04-26 Thread Jason Barnett
Angelo Zanetti wrote: 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); /*

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

2005-04-26 Thread Angelo Zanetti
sorry I'm not using array_diff_assoc just array_diff... Jason Barnett wrote: Angelo Zanetti wrote: 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

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

2005-04-26 Thread Jason Barnett
Angelo Zanetti wrote: sorry I'm not using array_diff_assoc just array_diff... /* Should also be able to re-index the diff of two arrays */ $diff = array_values(array_diff($a, $b)); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: problem with array and session

2002-08-12 Thread B.C. Lance
try this instead: session_start(); . . . if (mysql_num_rows($_query)) { $_rec = mysql_fetch_array($_query); if (!isset($_SESSION[bkmks]) || !in_array($_rec, $_SESSION[bkmks]) { $_SESSION[bkmks][] = $_rec; } else { echo Already exist.; } } to test: echo pre;

[PHP] RE: Problem with array

2002-04-30 Thread Tim Ward
Try some diagnostics to tell you what's going on In the page you're submitting to try Foreach($HTTP_POST_VARS as $key=$value) echo($key=$valuebr); Part of your problem may be that you're using the number of form elements returned to control the for loop. It doesn't really have any significance

[PHP] Re: Problem Inserting Array of Rows from form

2001-07-15 Thread James Tan
dear david, did u know u do not need to put single quote to enclose number type value?? notice ur field select syntax: INSERT INTO songs VALUES (' 1 // -- 1 is not enclosed with end quote... thus makes only 5 fields, not 6 , blah', ' ***', ' 45', ' 2', ' ') id[0]=: 2 try INSERT INTO songs

Re: [PHP] Re: Problem Inserting Array of Rows from form

2001-07-15 Thread David
I will try without single quotes for the id and other fields which have numeric values. For the original issue I was missing two single quotes. I was missing a single quote in the $val line after $id[$i] and before songname : I really don't need the quote for id since it is a numeric value. Here