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' =
Hi folks.
wat can be done to dis:
$z = array('foo' = array('bar')), 'dis' = array('dat'));
foreach(//???) {
echo //??? br //?? /p;
}
to output dis:
foo
bar
dis
dat
-
A passion till tomorrow,
Opeyemi Obembe | ng.clawz.com
Try this : --
$z = array('foo' = array('bar')), 'dis' = array('dat'));
while (list($key, $val) = each($z)) {
echo BR$key $val;
}
- Original Message -
From: Yemi Obembe [EMAIL PROTECTED]
To: php-db@lists.php.net
Sent: Monday, January 31, 2005 9:47 AM
Subject: [PHP-DB] foreach()
Hi
try...
$z = array('foo' = array('bar'), 'dis' = array('dat'));
foreach($z as $key = $value)
{
echo $key br $value[0] /p;
}
graeme.
Yemi Obembe wrote:
Hi folks.
wat can be done to dis:
$z = array('foo' = array('bar')), 'dis' = array('dat'));
foreach(//???) {
echo //??? br //?? /p;
}
to output dis:
= array('foo' = array('bar')), 'dis' = array('dat'));
while (list($key, $val) = each($z)) {
echo BR$key $val;
}
- Original Message - From: Yemi Obembe [EMAIL PROTECTED]
To: php-db@lists.php.net
Sent: Monday, January 31, 2005 9:47 AM
Subject: [PHP-DB] foreach()
Hi folks.
wat can be done
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
:
Subject: [PHP-DB] foreach() db
brainiacs please help?
09/09/2003 03:17
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 several
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 executing
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
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 the
]
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 value individually or can i do something with
$HTTP_POST_VARS or am
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,
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 name=deptsub_select
option-select-/option
)'
Subject: RE: [PHP-DB] foreach loop from MySQL select query to HTML
select list
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
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 wonderfully -
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 MySQL select query
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 =
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:
?PHP
$db = mysql_connect(myhost, username, );
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:
?PHP
$db
-
From: John Coder [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 28 November 2002 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
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 name=deptsub_select
option-select-/option
?PHP
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 now:
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 in
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
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:
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:
Warning:
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
James Kupernik
28 matches
Mail list logo