[PHP-DB] foreach

2012-04-05 Thread Ethan Rosenberg
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

Re: [PHP-DB] foreach()

2005-01-31 Thread graeme
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

Re: [PHP-DB] foreach()

2005-01-31 Thread graeme
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:

Re: [PHP-DB] foreach()

2005-01-31 Thread Han
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

[PHP-DB] foreach()

2005-01-31 Thread Yemi Obembe
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 -

Re: [PHP-DB] foreach() & db brainiacs please help?

2003-09-09 Thread jeffrey_n_Dyke
cc: Subject: [PHP-DB] foreach() & db brainiacs please help?

[PHP-DB] foreach() & db brainiacs please help?

2003-09-09 Thread Peter Sharpe
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

Re: [PHP-DB] foreach problem

2003-02-07 Thread Jason Wong
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

Re: [PHP-DB] foreach problem

2003-02-07 Thread Sam Folk-Williams
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

Re: [PHP-DB] foreach problem

2003-02-07 Thread Jason Wong
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

[PHP-DB] foreach problem

2003-02-07 Thread Sam Folk-Williams
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

Re: [PHP-DB] foreach($HTTP_POST_VARS as $key => $value)

2003-01-22 Thread Andrey Hristov
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

[PHP-DB] foreach($HTTP_POST_VARS as $key => $value)

2003-01-21 Thread Addison Ellis
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

RE: [PHP-DB] foreach loop from MySQL select query to HTML select list

2002-11-28 Thread Rick Widmer
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

RE: [PHP-DB] foreach loop from MySQL select query to HTML select list

2002-11-28 Thread Gavin Amm
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

RE: [PHP-DB] foreach loop from MySQL select query to HTML select list

2002-11-28 Thread John W. Holmes
> 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

RE: [PHP-DB] foreach loop from MySQL select query to HTML select list

2002-11-28 Thread Gavin Amm
{$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

RE: [PHP-DB] foreach loop from MySQL select query to HTML select list

2002-11-28 Thread John W. Holmes
> 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

Re: [PHP-DB] foreach loop from MySQL select query to HTML select list

2002-11-27 Thread Jason Wong
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

RE: [PHP-DB] foreach loop from MySQL select query to HTML select list

2002-11-27 Thread Gavin Amm
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

RE: [PHP-DB] foreach loop from MySQL select query to HTML select list

2002-11-27 Thread Gavin Amm
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

Re: [PHP-DB] foreach loop from MySQL select query to HTML selectlist

2002-11-27 Thread John Coder
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] foreach loop from MySQL select query to HTML select list

2002-11-27 Thread Gavin Amm
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

Re: [PHP-DB] foreach

2002-06-04 Thread James Kupernik
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

Re: [PHP-DB] foreach

2002-06-03 Thread Jason Wong
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

Re: [PHP-DB] foreach

2002-06-03 Thread James Kupernik
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:

Re: [PHP-DB] foreach

2002-06-03 Thread Pierre-Alain Joye
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

[PHP-DB] foreach

2002-06-03 Thread James Kupernik
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