Dear Lists -
I know I am missing something fundamental - but I have no idea where
to start to look.
Here are code snippets:
I have truncated the allowed_fields to make it easier to debug.
$allowed_fields = array( 'Site' =>'POST[Site]', 'MedRec' =>
'$_POST[MedRec]', 'Fname' => '$_POST[Fnam
element displayed.
graeme.
Han wrote:
Try this : --
$z = array('foo' => array('bar')), 'dis' => array('dat'));
while (list($key, $val) = each($z)) {
echo "$key $val";
}
- Original Message ----- From: "Yemi Obembe" <[EMA
try...
$z = array('foo' => array('bar'), 'dis' => array('dat'));
foreach($z as $key => $value)
{
echo "$key $value[0] ";
}
graeme.
Yemi Obembe wrote:
Hi folks.
wat can be done to dis:
$z = array('foo' => array('bar')), 'dis' => array('dat'));
foreach(//???) {
echo "//??? //?? ";
}
to output dis:
Try this : --
$z = array('foo' => array('bar')), 'dis' => array('dat'));
while (list($key, $val) = each($z)) {
echo "$key $val";
}
- Original Message -
From: "Yemi Obembe" <[EMAIL PROTECTED]>
To:
Sent: Monday, Janu
Hi folks.
wat can be done to dis:
$z = array('foo' => array('bar')), 'dis' => array('dat'));
foreach(//???) {
echo "//??? //?? ";
}
to output dis:
foo
bar
dis
dat
-
A passion till tomorrow,
Opeyemi Obembe | ng.clawz.com
-
cc:
Subject: [PHP-DB] foreach() & db
brainiacs please help?
I have a database full of names. each name could be linked to any number of
sub-names, each sub-name could be linked to any number of sub-sub-names, to
infinity (unlikely but possible).
I need to iterate through this nest of names starting with a main name; lets
call the main name Peter. Peter cou
On Saturday 08 February 2003 06:16, Sam Folk-Williams wrote:
> I don't get any MySQL error... It adds the first entry_id and date exactly
> as it should... it seems to be acting like entry_date is not an array, but
> when I use the same foreach loop to echo the contents of entry_date it
> echoes th
I don't get any MySQL error... It adds the first entry_id and date exactly
as it should... it seems to be acting like entry_date is not an array, but
when I use the same foreach loop to echo the contents of entry_date it
echoes the multiple values (2003-05-01, 2003-05-02, etc)... I use the same
cod
On Friday 07 February 2003 11:22, Sam Folk-Williams wrote:
> Hi,
>
> I can't figure out why this won't work:
>
> foreach($event_date as $val) {
>
> $sql2 = "INSERT INTO cal_date_map (entry_id, date) VALUES (\"$entry_id\",
> \"$val\")";
> $result = @mysql_query($sql2,$connection) or die
> ("Problem
Hi,
I can't figure out why this won't work:
foreach($event_date as $val) {
$sql2 = "INSERT INTO cal_date_map (entry_id, date) VALUES (\"$entry_id\",
\"$val\")";
$result = @mysql_query($sql2,$connection) or die
("Problem executing foreach database query.");
}
$event_date is an array with sever
ROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, January 22, 2003 9:24 AM
Subject: [PHP-DB] foreach($HTTP_POST_VARS as $key => $value)
> hello,
> i do appreciate your time...
> below the code following i don't know where to go. do i need
> to list each val
hello,
i do appreciate your time...
below the code following i don't know where to go. do i need
to list each value individually or can i do something with
$HTTP_POST_VARS or am i even headed in the right direction? i am
trying to point all my forms to this .php file to check for errors,
and
At 10:40 AM 11/29/02 +1100, Gavin Amm wrote:
hmm, interesting to know the mysql_fetch_array() by default returns an array
that's associative AND numeric - very useful to know & something i'll have
to look into more, thanks Jason.
Using PHP's built in template system...
$result_dept = mysql_quer
thanks John,
i was thinking along similar lines.
that should work well.
cheers,
Gav
-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Friday, 29 November 2002 4:08 PM
To: 'Gavin Amm'; 'Php-Db (E-mail)'
Subject: RE: [PHP-DB] foreach loop from M
> hmm, interesting to know the mysql_fetch_array() by default returns an
> array
> that's associative AND numeric - very useful to know & something i'll
have
> to look into more, thanks Jason.
>
> Thanks also John, puting curley braces around the variables is a
valuable
> lesson - works wonderfull
{$row['dept']}\n";
}
?>
cheers, Gav
-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED]]
Sent: Friday, 29 November 2002 2:59 AM
To: 'Gavin Amm'; 'Php-Db (E-mail)'
Subject: RE: [PHP-DB] foreach loop from MySQL select query to HTML
select l
> i've looked around the web a bit more & it would appear you can't just
use
> a
> foreach function, apparently you need to use a while{foreach{}}
structure.
> i
> was hoping you could just use the foreach function?
>
> so this is the code now:
>
>
> -select-
> while ($row = mysql_fet
On Thursday 28 November 2002 14:21, Gavin Amm wrote:
> ok,
>
> i've looked around the web a bit more & it would appear you can't just use
> a foreach function, apparently you need to use a while{foreach{}}
> structure. i was hoping you could just use the foreach function?
>
> so this is the code no
ok,
i've looked around the web a bit more & it would appear you can't just use a
foreach function, apparently you need to use a while{foreach{}} structure. i
was hoping you could just use the foreach function?
so this is the code now:
-select-
$value\n";
}
}
?>
but now th
002 3:44 PM
To: Gavin Amm
Cc: Php-Db (E-mail)
Subject: Re: [PHP-DB] foreach loop from MySQL select query to HTML
select list
On Wed, 2002-11-27 at 23:33, Gavin Amm wrote:
> Hi,
>
> I'm trying to pick up data from my MySQL database, use a foreach loop to
> extact the data from th
On Wed, 2002-11-27 at 23:33, Gavin Amm wrote:
> Hi,
>
> I'm trying to pick up data from my MySQL database, use a foreach loop to
> extact the data from the result & put that data into a select list.
>
> I have tried the following code with & without the $row = ... line, both
> unsucessfully:
>
>
Hi,
I'm trying to pick up data from my MySQL database, use a foreach loop to
extact the data from the result & put that data into a select list.
I have tried the following code with & without the $row = ... line, both
unsucessfully:
-select-
$value\n";}
?>
I get the following er
found my problem .. thank you for your help! You guy put me in the right
direction to solve this problem.
Thanks!!
"Jason Wong" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Tuesday 04 June 2002 00:52, James Kupernik wrote:
> > yes because I'm using it i
On Tuesday 04 June 2002 00:52, James Kupernik wrote:
> yes because I'm using it in another foreach, but this one doesn't want to
> work.
>
>
> "Pierre-Alain Joye" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> > On Mon, 3 Jun 2002 12:48:47 -0400
> >
> > "Ja
yes because I'm using it in another foreach, but this one doesn't want to
work.
"Pierre-Alain Joye" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Mon, 3 Jun 2002 12:48:47 -0400
> "James Kupernik" <[EMAIL PROTECTED]> wrote:
>
> >
> > and I'm getting this:
On Mon, 3 Jun 2002 12:48:47 -0400
"James Kupernik" <[EMAIL PROTECTED]> wrote:
>
> and I'm getting this:
> Warning: Invalid argument supplied for foreach()
>
> Why is that?
are you sure $cart is an array ?
pa
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www
I'm using this:
if($save)
{
foreach ($cart as $record => $qty)
{
if($$record=="0")
unset($cart[$record]);
else
$cart[$record] = $$record;
}
$totalPrice = calculate_price($cart);
$items = calculate_items($cart);
}
and I'm getting this:
Warning: Invalid argument sup
28 matches
Mail list logo