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]=
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);
/*
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
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
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;
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
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
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
8 matches
Mail list logo