[PHP] Re: Foreach and mydql_query problem

2013-07-22 Thread Tim Streater
On 22 Jul 2013 at 12:56, Karl-Arne Gjersøyen karlar...@gmail.com wrote: Yes, i know that only one a singe row is updated and that is the problem. What can I do to update several rows at the same time? Which several rows? The row that will be updated is that (or those) that match your WHERE

[PHP] Re: Foreach and mydql_query problem

2013-07-22 Thread Karl-Arne Gjersøyen
2013/7/22 Tim Streater t...@clothears.org.uk On 22 Jul 2013 at 12:56, Karl-Arne Gjersøyen karlar...@gmail.com wrote: Yes, i know that only one a singe row is updated and that is the problem. What can I do to update several rows at the same time? Which several rows? The row that will be

[PHP] Re: foreach

2012-04-05 Thread Jim Giner
I don't know about others, but I can't make sense of this - way too much presented with no idea of what I am looking at - code or output. One thing: $_Request is not the same var as $_REQUEST. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Re: foreach

2012-04-05 Thread Al
On 4/5/2012 4:15 PM, Ethan Rosenberg wrote: 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' =

[PHP] Re: foreach and destroying variables for memory saving

2008-12-10 Thread Carlos Medina
Tim | iHostNZ schrieb: Hi All, Just to annoy the hell out of you, another thing that has been on my mind for a while: I love the foreach ($ar as $k = $v) { ... } construct and use it all the time. However, I read somewhere that foreach actually uses a copy of $ar instead of the array itself by

[PHP] Re: foreach and destroying variables for memory saving

2008-12-10 Thread Gal Gur-Arie
Tim | iHostNZ wrote: Hi All, Just to annoy the hell out of you, another thing that has been on my mind for a while: I love the foreach ($ar as $k = $v) { ... } construct and use it all the time. However, I read somewhere that foreach actually uses a copy of $ar instead of the array

[PHP] Re: foreach questions

2008-01-01 Thread jekillen
On Jan 1, 2008, at 11:59 AM, Martin Jerga wrote: Hello, the problem is in this part of code $key - $value This notation means that you are trying to access property $value on the object $key. Just replace it with $key = $value and you will get the result as expected. Martin J Thank

[PHP] Re: foreach questions

2008-01-01 Thread Martin Jerga
Hello, the problem is in this part of code $key - $value This notation means that you are trying to access property $value on the object $key. Just replace it with $key = $value and you will get the result as expected. Martin J jekillen wrote / napísal(a): Hello; I have this section of

Re: [PHP] Re: foreach questions

2008-01-01 Thread Richard Lynch
Hit send too soon. Sorry! On Tue, January 1, 2008 2:05 pm, jekillen wrote: Several questions: How long can an index be in an associative array? (the indexes I use in this array are 32 character hashes) As far as I know, it can be as big as your RAM will hold... Can it start with a number

Re: [PHP] Re: foreach questions

2008-01-01 Thread jekillen
On Jan 1, 2008, at 3:34 PM, Richard Lynch wrote: Hit send too soon. Sorry! On Tue, January 1, 2008 2:05 pm, jekillen wrote: Several questions: How long can an index be in an associative array? (the indexes I use in this array are 32 character hashes) As far as I know, it can be as big as

[PHP] Re: foreach / unset

2005-10-29 Thread Bogdan Ribic
Richard Lynch wrote: Anyway, can you do *this* safely as a DOCUMENTED FEATURE: foreach($array as $k = $v){ if (...) unset($array[$k]); } Well, somewhere in the said manual it is written that foreach operates on a *copy* of the array, so you should be safe unsetting values in the

[PHP] Re: Foreach problem.

2005-02-09 Thread Jason Barnett
Since you didn't post how you created the array, I went ahead and (ugh!) did it myself. This works fine. ?php $elementsarr = Array ('knr', 'subject', 'title', 'kat', 'pages', 'access', 'dofile', MAX_FILE_SIZE, 'pdf', 'dolink', 'link', 'erstam', 'endless', 'from', 'until', 'openbem', 'history',

Re: [PHP] Re: foreach()

2004-09-10 Thread Wouter van Vliet
On Wed, 08 Sep 2004 16:41:38 +0200, Daniel Kullik [EMAIL PROTECTED] wrote: Anthony Ritter wrote: I get a: Warning: Invalid argument supplied for foreach() in c:\apache\htdocs\or_6.4.php on line 15 after submitting the form. Hello Anthony! As long as you don't submit the form

[PHP] Re: foreach()

2004-09-08 Thread Daniel Kullik
Anthony Ritter wrote: I get a: Warning: Invalid argument supplied for foreach() in c:\apache\htdocs\or_6.4.php on line 15 after submitting the form. Hello Anthony! As long as you don't submit the form with a single option selected there will be no $_POST['lunch'], therefore foreach() won't be

[PHP] Re: Foreach Array Help

2003-10-14 Thread Rob Adams
Jed R. Brubaker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Okay, total newbie when it comes to arrays, and I could really use some help. I sure this will be an easy one for you veterans out there. Here is the array ($code): array(2) { [total]= int(1) [assign]=

[PHP] Re: Foreach Array Help

2003-10-14 Thread Jed R. Brubaker
First of all, thanks for the response. Here is where I am getting lost: In $code['assign'][1] - 1 is the assignment ID, and I would like the array to be able to hold a billion of these different assignments all with conceivably a billion codeapply ID as in $code['assign'][1]['codeapply'][3],

[PHP] Re: Foreach Array Help

2003-10-14 Thread Jed R. Brubaker
Never mind - I figured it out. While I was traversing like this: foreach ($this-code['assign'] as $assign = $details) { foreach ($assign['codeapply'] as $codeapply = $ca_details) { } } I had set up $assign to be the key value, and

[PHP] Re: Foreach Array Help

2003-10-14 Thread Rob Adams
Jed R. Brubaker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] First of all, thanks for the response. Here is where I am getting lost: In $code['assign'][1] - 1 is the assignment ID, and I would like the array to be able to hold a billion of these different assignments all with

[PHP] Re: Foreach POST VARS problem

2003-08-15 Thread Catalin Trifu
hi, Are you sure the data is posted from HTML through POST ? try adding the lines below: $colors=; if(is_array($HTTP_POST_VARS) !empty($HTTP_POST_VARS )) { foreach($HTTP_POST_VARS as $ThisVar=$ThisVal){ if(ereg(color-, $ThisVar) AND $ThisVal==on OR $ThisVal==1){

[PHP] Re: Foreach POST VARS problem

2003-08-15 Thread Catalin Trifu
btw! if you use it inside a function, you need to declare it as global! Catalin Are you sure the data is posted from HTML through POST ? try adding the lines below: $colors=; if(is_array($HTTP_POST_VARS) !empty($HTTP_POST_VARS )) { foreach($HTTP_POST_VARS as

[PHP] Re: Foreach ...... Help

2002-11-06 Thread Remon Redika
Parse error: parse error, unexpected '=' in /home/intra/Inventroot/software/savedata.php on line 35 ?php $vary(100); $i = 0; foreach($InputY as $y){ $vary($i) = $y; -line 35 $i++; } foreach($Nama_Software as $x){ $insertq = Insert into NSoftware (X, Y) values

Re: [PHP] Re: Foreach ...... Help

2002-11-06 Thread Rasmus Lerdorf
Your code is bogus. You probably want: $vary[$i] = $y; And $vary(100) also makes no sense. Also, why are you looping through the $InputY array and putting all the values into $vary? Why not just do $vary = $InputY; ? If it is because you need to renumber the indices, have a look at the

[PHP] Re: Foreach ...... Help

2002-11-06 Thread Remon Redika
Sorry before. I Just to try to Explain my Problem may be this my reason .. I have Two Text Fields The First Text Field i call it InputX input type='text' name='InputX' size='50' and The Second Text Field I Call it InputY, Generatable Field (using javascripts), if User Click the Button

[PHP] Re: foreach, side effect or good behaviour?

2002-09-23 Thread Stephan Seidt
It's good behavoiur because everytime even a reference gets a value, also the target which it is pointing on should get the same value. On Mon, 23 Sep 2002 12:57:56 +0200 (CEST), [EMAIL PROTECTED] (Jean-Pierre arneodo) wrote: Hi, $a=1; $b=$a; foreach(array(2,3) as $b); echo a=$a; //

[PHP] Re: foreach fails on unitialized array?

2002-08-30 Thread Richard Lynch
When I use foreach on a uninitialized array I get the following warning: Warning: Invalid argument supplied for foreach() in /www/htdocs/jc/cart/add_item.php on line 21 I would expect foreach to treat an unitialized variable as an empty array and hence do nothing. Is this the expected

[PHP] Re: foreach fails on unitialized array?

2002-08-30 Thread Richard Lynch
From: "Richard Lynch" [EMAIL PROTECTED] If you absolute *MUST* refuse to initialize the array (BAD IDEA!) You would be *MUCH* better off listening to those warnings and fixing your code. I totally agree with. I was just peeved that PHP would handle unitiliazed strings without a warning (a

[PHP] Re: foreach not in reach

2002-02-22 Thread David Robley
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Question 1: How can I append strings to my authors array? Me thinks this doesn't work :§) ? $authors .= explode(;, $mydata-KW); I'm getting Invalid argument supplied for foreach() Question 2: Once I get this working, I want to (a)

[PHP] Re: foreach array into mail isn´t working

2002-01-21 Thread Ken Gregg
Blank lines are important to the parsing of mail messages. File does not strip newlines. Try your code and strip the newlines off the email addresses. If you still have problems try it and drop the newlines from the subject. Ken Gregg Enhanced Data Systems, Inc. http://www.rwre.com for the

[PHP] Re: Foreach loop syntax

2001-08-14 Thread Richard Lynch
Ok, I asked a similar question more than a year ago, so I apologize for being a little redundant :) Why was PHP's foreach loop syntax chosen to be foreach($dogs as $dog){} instead of something more common (Python, Javascript, can't think what else right now) and, to me, more intuitive,

[PHP] RE: foreach and multiple arrays

2001-07-30 Thread Tim Ward
Why can't you create the arrays as associative arrays in the first place $fred[] = array(title=Apple,value=Red,size1=10,size2=20); $fred[] = array(title=Banana,value=Yellow,size1=10,size2=20); then foreach($fred as $thisfred) foreach ($thisfred as