Re: [PHP] While on the topic of PHP Web Site Stats - SharePoint...

2011-09-19 Thread Daniel Brown
On Mon, Sep 19, 2011 at 18:22, George Langley george.lang...@shaw.ca wrote:        Hi all. Had a meeting today where I was rather condescendingly told that most CMS web sites use SharePoint. Well, you may reply, equally condescendingly, that you will need that to have cited references, as

Re: [PHP] WHILE LOOP PROBLEM

2009-03-27 Thread Craig Whitmore
On Fri, 2009-03-27 at 08:11 +, Andrew Williams wrote: can some tell why the below loop stop running after some time. $start=10; const run=0; while($start run){ //do somthing } max_execution_time -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] WHILE LOOP PROBLEM

2009-03-27 Thread Arno Kuhl
-Original Message- From: Andrew Williams [mailto:andrew4willi...@gmail.com] Sent: 27 March 2009 10:12 AM To: PHP LIST Subject: [PHP] WHILE LOOP PROBLEM can some tell why the below loop stop running after some time. $start=10; const run=0; while($start run){ //do somthing } -- The

RE: [PHP] while-question

2008-11-19 Thread bruce
-general@lists.php.net Subject: RE: [PHP] while-question Dabbling? I think that making a living from it isn't dabbling, so I may not be qualified to speak for the dabblers. But for me, I was writing code before there were such courses. Later, when I went to college I was taught

Re: [PHP] while-question

2008-11-19 Thread Shawn McKenzie
bruce wrote: interesting points regarding college and programming.. my degrees bsee/msee covered alot more than pure programing.. as a double ee/cs, the ability to articulate an issue/problem, and bring to mind a cogent thought process was valuable. the ability to understand how different

Re: [PHP] while question

2008-11-18 Thread Nathan Rixham
Ashley Sheridan wrote: On Mon, 2008-11-17 at 18:01 -0500, Craige Leeder wrote: Ashley Sheridan wrote: On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote: Only thing to note with the foreach is that you are actually working on a copy of the array, so if you intend to modify it, pass it

Re: [PHP] while-question

2008-11-18 Thread Nathan Rixham
tedd wrote: At 7:02 PM -0500 11/17/08, Craige Leeder wrote: I'm not illiterate; promise :p - Craige Yeah, his parents were married before he was born. Cheers, tedd omg tedd, I was just reading this thread over, thought exactly that witty response, clicked you're reply and there it is;

Re: [PHP] while-question

2008-11-18 Thread Craige Leeder
Jochem Maas wrote: just for laughs .. given the 'dabble' thread Cleeder is phonetically very very close to a dutch word meaning 'messing around' .. rather in the way a 2yo might mess around with a bowl of yogurt. Haha, now that does make me laugh. Out of curiosity, what is the actual word

Re: [PHP] while-question

2008-11-18 Thread Jochem Maas
Craige Leeder schreef: Jochem Maas wrote: just for laughs .. given the 'dabble' thread Cleeder is phonetically very very close to a dutch word meaning 'messing around' .. rather in the way a 2yo might mess around with a bowl of yogurt. Haha, now that does make me laugh. Out of curiosity,

Re: [PHP] while-question

2008-11-18 Thread Craige Leeder
Jochem Maas wrote: klieder ... kliederen the E sound is short. Interesting to know. Thanks :D - Craige -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] while-question

2008-11-18 Thread Nathan Rixham
Craige Leeder wrote: Jochem Maas wrote: klieder ... kliederen the E sound is short. Interesting to know. Thanks :D - Craige don't believe him, jochem is really called Bob Davis, a slightly balding middle aged ASP developer from hull sent to infiltrate the PHP community and misguide

Re: [PHP] while-question

2008-11-18 Thread Bastien Koert
On Tue, Nov 18, 2008 at 9:33 AM, Nathan Rixham [EMAIL PROTECTED] wrote: Craige Leeder wrote: Jochem Maas wrote: klieder ... kliederen the E sound is short. Interesting to know. Thanks :D - Craige don't believe him, jochem is really called Bob Davis, a slightly balding middle aged

Re: [PHP] while-question

2008-11-18 Thread Robert Cummings
On Tue, 2008-11-18 at 14:33 +, Nathan Rixham wrote: Craige Leeder wrote: Jochem Maas wrote: klieder ... kliederen the E sound is short. Interesting to know. Thanks :D - Craige don't believe him, jochem is really called Bob Davis, a slightly balding middle aged ASP

Re: [PHP] while question

2008-11-18 Thread Ashley Sheridan
On Tue, 2008-11-18 at 10:52 +, Nathan Rixham wrote: Ashley Sheridan wrote: On Mon, 2008-11-17 at 18:01 -0500, Craige Leeder wrote: Ashley Sheridan wrote: On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote: Only thing to note with the foreach is that you are actually working

Re: [PHP] while question

2008-11-17 Thread Stut
On 17 Nov 2008, at 13:01, Alain Roger wrote: i'm on PHP training and our lector is telling us that to avoid counting an array item amout thanks count($my_array), he tells we can do: while($my_array) { ... do something } but from experience this is an infinity loop... it should be always

Re: [PHP] while question

2008-11-17 Thread Thodoris
Hi, i'm on PHP training and our lector is telling us that to avoid counting an array item amout thanks count($my_array), he tells we can do: while($my_array) { ... do something } but from experience this is an infinity loop... it should be always something like $count = count($my_array);

RE: [PHP] while question

2008-11-17 Thread Jay Blanchard
[snip] ...foreach... [/snip] You could also use a for loop if you wanted to count; for($i = 0; $i count($array); $i++){ echo $i . \n; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] while-question

2008-11-17 Thread Jochem Maas
Timo Erbach schreef: ...but for best performance you should do: $counter = count($array); for($i = 0; $i $counter; $i++){ echo $i . \n; } just for fun: $a = range(1,10); for ($i = 0, $c = count($a); $i $c; print($a[$i].\n), $i++); ... gives an idea of the power and flexibility of a

Re: [PHP] while-question

2008-11-17 Thread Nathan Rixham
Jochem Maas wrote: $a = range(1,10); for ($i = 0, $c = count($a); $i $c; print($a[$i].\n), $i++); think the point of this is to count the items in an array without count mate :p no point in the above you could just: $c = count($a); foreach! $a = range(1,10); $c = 0; foreach($a as $b) {

Re: [PHP] while-question

2008-11-17 Thread Jochem Maas
Nathan Rixham schreef: Jochem Maas wrote: $a = range(1,10); for ($i = 0, $c = count($a); $i $c; print($a[$i].\n), $i++); think the point of this is to count the items in an array without count mate :p no point in the above you could just: $c = count($a); I thought the point was to avoid

Re: [PHP] while-question

2008-11-17 Thread Stut
On 17 Nov 2008, at 14:31, Nathan Rixham wrote: if you really want a challenge try this one.. task: add the numbers 5 and 17 together, using php, without using the + operator. fill it in: function add($a , $b) { //code here but no + - / * operators return $answer; } echo add(5, 17);

Re: [PHP] while-question

2008-11-17 Thread Andrew Ballard
On Mon, Nov 17, 2008 at 9:47 AM, Jochem Maas [EMAIL PROTECTED] wrote: Nathan Rixham schreef: Jochem Maas wrote: $a = range(1,10); for ($i = 0, $c = count($a); $i $c; print($a[$i].\n), $i++); think the point of this is to count the items in an array without count mate :p no point in the

Re: [PHP] while-question

2008-11-17 Thread Nathan Rixham
Stut wrote: On 17 Nov 2008, at 14:31, Nathan Rixham wrote: if you really want a challenge try this one.. task: add the numbers 5 and 17 together, using php, without using the + operator. fill it in: function add($a , $b) { //code here but no + - / * operators return $answer; } echo add(5,

Re: [PHP] while-question

2008-11-17 Thread Robert Cummings
On Mon, 2008-11-17 at 14:54 +, Stut wrote: On 17 Nov 2008, at 14:31, Nathan Rixham wrote: if you really want a challenge try this one.. task: add the numbers 5 and 17 together, using php, without using the + operator. fill it in: function add($a , $b) { //code here but no + -

RE: [PHP] while-question

2008-11-17 Thread bruce
... ? -Original Message- From: Robert Cummings [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2008 9:53 AM To: Stut Cc: Nathan Rixham; php-general@lists.php.net Subject: Re: [PHP] while-question On Mon, 2008-11-17 at 14:54 +, Stut wrote: On 17 Nov 2008, at 14:31, Nathan Rixham wrote

Re: [PHP] while-question

2008-11-17 Thread Jochem Maas
Robert Cummings schreef: On Mon, 2008-11-17 at 14:54 +, Stut wrote: On 17 Nov 2008, at 14:31, Nathan Rixham wrote: if you really want a challenge try this one.. task: add the numbers 5 and 17 together, using php, without using the + operator. fill it in: function add($a , $b) {

RE: [PHP] while-question

2008-11-17 Thread Robert Cummings
On Mon, 2008-11-17 at 10:00 -0800, bruce wrote: curious qiestion to all on here who dabble in php... how many of you have actully gone to college, taken algorithm courses, microprocessor courses, design/architecture courses, etc.. or is the majority of the work here from people who've

Re: [PHP] while-question

2008-11-17 Thread Robert Cummings
On Mon, 2008-11-17 at 19:07 +0100, Jochem Maas wrote: Robert Cummings schreef: On Mon, 2008-11-17 at 14:54 +, Stut wrote: On 17 Nov 2008, at 14:31, Nathan Rixham wrote: if you really want a challenge try this one.. task: add the numbers 5 and 17 together, using php, without using

Re: [PHP] while-question

2008-11-17 Thread Nathan Rixham
bruce wrote: curious qiestion to all on here who dabble in php... how many of you have actully gone to college, taken algorithm courses, microprocessor courses, design/architecture courses, etc.. or is the majority of the work here from people who've grabbed the tools and started

RE: [PHP] while-question

2008-11-17 Thread tedd
At 10:00 AM -0800 11/17/08, bruce wrote: curious qiestion to all on here who dabble in php... how many of you have actully gone to college, taken algorithm courses, microprocessor courses, design/architecture courses, etc.. or is the majority of the work here from people who've grabbed the

RE: [PHP] while-question

2008-11-17 Thread Wolf
Dabbling? I think that making a living from it isn't dabbling, so I may not be qualified to speak for the dabblers. But for me, I was writing code before there were such courses. Later, when I went to college I was taught adventures in keypunching and received several next to

RE: [PHP] while-question

2008-11-17 Thread tedd
At 2:55 PM -0500 11/17/08, Wolf wrote: Tedd, glad you got hooked on Phonics. One of these days I hope from graduating from just looking at the pictures, but right now the pictures are oh so enticing!. ;) Wolf Wolf: Lot's of exciting things -- hard to keep up on bots, automated buying,

Re: [PHP] while question

2008-11-17 Thread Craige Leeder
Alain Roger wrote: Hi, i'm on PHP training and our lector is telling us that to avoid counting an array item amout thanks count($my_array), he tells we can do: while($my_array) { ... do something } but from experience this is an infinity loop... it should be always something like $count =

Re: [PHP] while question

2008-11-17 Thread Ashley Sheridan
On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote: Alain Roger wrote: Hi, i'm on PHP training and our lector is telling us that to avoid counting an array item amout thanks count($my_array), he tells we can do: while($my_array) { ... do something } but from experience this

Re: [PHP] while question

2008-11-17 Thread Craige Leeder
Ashley Sheridan wrote: On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote: Only thing to note with the foreach is that you are actually working on a copy of the array, so if you intend to modify it, pass it by reference. - Craige Can you do that? I assume it would look like this:

Re: [PHP] while question

2008-11-17 Thread Ashley Sheridan
On Mon, 2008-11-17 at 18:01 -0500, Craige Leeder wrote: Ashley Sheridan wrote: On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote: Only thing to note with the foreach is that you are actually working on a copy of the array, so if you intend to modify it, pass it by reference.

Re: [PHP] while-question

2008-11-17 Thread Craige Leeder
bruce wrote: curious qiestion to all on here who dabble in php... how many of you have actully gone to college, taken algorithm courses, microprocessor courses, design/architecture courses, etc.. or is the majority of the work here from people who've grabbed the tools and started

Re: [PHP] while-question

2008-11-17 Thread Jochem Maas
Craige Leeder schreef: bruce wrote: curious qiestion to all on here who dabble in php... how many of you have actully gone to college, taken algorithm courses, microprocessor courses, design/architecture courses, etc.. or is the majority of the work here from people who've grabbed the

Re: [PHP] while-question

2008-11-17 Thread Jochem Maas
tedd schreef: At 10:00 AM -0800 11/17/08, bruce wrote: curious qiestion to all on here who dabble in php... how many of you have actully gone to college, taken algorithm courses, microprocessor courses, design/architecture courses, etc.. or is the majority of the work here from people

Re: [PHP] while-question

2008-11-17 Thread Craige Leeder
Jochem Maas wrote: must . resist I take you didn't score to hig on the spelling test? and collage, is that the the cut-n-paste school of IT? dang it, failed. ;-) Haha! 'high' was just my 'h' key not pressing, and college is just one of those words I have trouble with.

Re: [PHP] while question

2008-11-17 Thread Jochem Maas
Craige Leeder schreef: Ashley Sheridan wrote: On Mon, 2008-11-17 at 17:47 -0500, Craige Leeder wrote: Only thing to note with the foreach is that you are actually working on a copy of the array, so if you intend to modify it, pass it by reference. - Craige Can you do that? I

Re: [PHP] while-question

2008-11-17 Thread tedd
At 12:52 AM +0100 11/18/08, Jochem Maas wrote: Craige Leeder schreef: I'm 100% self taught for now. I'm just out of higschool, and hopefully going off to collage next year. must . resist I take you didn't score to hig on the spelling test? and collage, is that the the

Re: [PHP] while-question

2008-11-17 Thread tedd
At 7:02 PM -0500 11/17/08, Craige Leeder wrote: I'm not illiterate; promise :p - Craige Yeah, his parents were married before he was born. Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] while question

2008-11-17 Thread Micah Gersten
Jay Blanchard wrote: [snip] ...foreach... [/snip] You could also use a for loop if you wanted to count; for($i = 0; $i count($array); $i++){ echo $i . \n; } This is not good because you are calling count every loop iteration. Thank you, Micah Gersten onShore Networks Internal

Re: [PHP] while-question

2008-11-17 Thread Jochem Maas
tedd schreef: At 12:52 AM +0100 11/18/08, Jochem Maas wrote: Craige Leeder schreef: I'm 100% self taught for now. I'm just out of higschool, and hopefully going off to collage next year. must . resist I take you didn't score to hig on the spelling test? and collage, is that

Re: [PHP] while-question

2008-11-17 Thread Jochem Maas
Craige Leeder schreef: Jochem Maas wrote: must . resist I take you didn't score to hig on the spelling test? and collage, is that the the cut-n-paste school of IT? dang it, failed. ;-) Haha! 'high' was just my 'h' key not pressing, and college is just one of those

Re: [PHP] while

2008-02-23 Thread Andrew Ballard
On Sat, Feb 23, 2008 at 11:16 AM, Emiliano Boragina [EMAIL PROTECTED] wrote: Hi everyone I am beginner I have the following code: ? $buscar = $_REQUEST['buscar']; $base = inscripcion; $conexion = mysql_connect ( 'localhost' , 'root' , 'root' );

Re: [PHP] while

2008-02-23 Thread Richard Lynch
On Sat, February 23, 2008 10:16 am, Emiliano Boragina wrote: ? $buscar = $_REQUEST['buscar']; $base = inscripcion; $conexion = mysql_connect ( 'localhost' , 'root' , 'root' ); mysql_select_db ( $base , $conexion ); echo table border='1';

Re: [PHP] while-do +array

2007-10-31 Thread Robert Cummings
On Wed, 2007-10-31 at 13:02 +0200, Steven Macintyre wrote: Hiya, I have the following code ... which only seems to result in one item ... which is incorrect ... can anyone spot my problem? Your subject line says while-do + array, following code contains a do-while loop. We can't debug the

RE: [PHP] while-do +array

2007-10-31 Thread Steven Macintyre
Your subject line says while-do + array, following code contains a do-while loop. Apologies :) We can't debug the script very well without a sample input since we don't know how many times the loop should run. To debug yourself, try using print_r() to see exactly what the following

RE: [PHP] while-do +array

2007-10-31 Thread Robert Cummings
On Wed, 2007-10-31 at 16:20 +0200, Steven Macintyre wrote: Your subject line says while-do + array, following code contains a do-while loop. Apologies :) We can't debug the script very well without a sample input since we don't know how many times the loop should run. To debug

Re: [PHP] while-do +array

2007-10-31 Thread Robin Vickery
On 31/10/2007, Steven Macintyre [EMAIL PROTECTED] wrote: Hiya, I have the following code ... which only seems to result in one item ... which is incorrect ... can anyone spot my problem? if ($armbase != ) { $options = explode(,, $armbase); $text .=

Re: [PHP] While and echoing HTML

2005-05-10 Thread Prathaban Mookiah
I guess it is the missing semicolon. And you can write: echo trtd? echo $product_type ?/td/tr as simply echo trtd$product_type/td/tr Prathap -- Original Message --- From: Mark Sargent [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Tue, 10 May 2005 13:23:51 +0900

Re: [PHP] While and echoing HTML

2005-05-10 Thread =?iso-8859-1?q?Fabian_M=FCller?=
Mark Sargent [EMAIL PROTECTED] writes: $i=0; while ($i $num){ $product_type=mysql_result($result,$i,product_type_detail); echo trtd? echo $product_type ?/td/tr } $i++ You should put $i++ into the while loop. And you should add an ; at the end of the echo line as well as at the end of

Re: [PHP] While and echoing HTML

2005-05-10 Thread Mark Sargent
Prathaban Mookiah wrote: I guess it is the missing semicolon. And you can write: echo trtd? echo $product_type ?/td/tr as simply echo trtd$product_type/td/tr Prathap -- Original Message --- From: Mark Sargent [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Tue, 10 May 2005

Re: [PHP] While and echoing HTML

2005-05-10 Thread Mary-Anne Nayler
oh, and the i++ should be inside the while loop and there is also a missing semi colon after the echo, ie; $i=0; while ($i $num){ $product_type=mysql_result($result,$i,product_type_detail); echo trtd? echo $product_type ?/td/tr; $i++ ; } Mark Sargent wrote, On 10/05/05 02:23 PM: Hi All, this

Re: [PHP] While and echoing HTML

2005-05-10 Thread darren kirby
quoth the Mark Sargent: snip html body h1centerJumbo Status/center/h1br ?php $db = mysql_connect(localhost, root, grunger); mysql_select_db(status,$db); $result = mysql_query(SELECT ProductTypes.product_type_detail FROM ProductTypes,$db); $myrow = mysql_fetch_array($result); $num =

Re: [PHP] While and echoing HTML

2005-05-10 Thread Mary-Anne Nayler
Hi Mark, As far as I can see the only problem is that you have forgotten to add a semicolon after the i++ Cheers, Mary-Anne Mark Sargent wrote, On 10/05/05 02:23 PM: Hi All, this page, http://www.freewebmasterhelp.com/tutorials/phpmysql/5 has the below code, ? $i=0; while ($i $num) {

Re: [PHP] While and echoing HTML

2005-05-10 Thread Mark Sargent
Mary-Anne Nayler wrote: oh, and the i++ should be inside the while loop and there is also a missing semi colon after the echo, ie; $i=0; while ($i $num){ $product_type=mysql_result($result,$i,product_type_detail); echo trtd? echo $product_type ?/td/tr; $i++ ; } Mark Sargent wrote, On 10/05/05

Re: [PHP] While and echoing HTML

2005-05-10 Thread Richard Lynch
On Mon, May 9, 2005 10:57 pm, Mark Sargent said: Thanx. I saw the extra echo and removed it. Problem with that code, though. It displays only the 1st record, repeatedly, causing the browser to hang. Can anyone see what is wrong..? Cheers. Everybody else has told you to move the $i++; inside

Re: [PHP] While and echoing HTML

2005-05-10 Thread Burhan Khalid
Mary-Anne Nayler wrote: Hi Mark, As far as I can see the only problem is that you have forgotten to add a semicolon after the i++ Mark: Since you are not displaying the counter, you really don't need to mess with $i. You can reduce your code to just : ?php $db = mysql_connect(localhost,

RE: [PHP] While and echoing HTML

2005-05-10 Thread Jared Williams
I guess it is the missing semicolon. And you can write: echo trtd? echo $product_type ?/td/tr as simply echo trtd$product_type/td/tr I prefer echo 'trtd', $product_type, '/td/tr'; No string concatenation, or variable replacement required. Jared -- PHP General Mailing List

Re: [PHP] while loop

2005-02-23 Thread Burhan Khalid
Reinhart Viane wrote: Hey list I have a mysql table like this: [ snipped ] Now I retrieve all activities happening in the future with this query: $sqlact=select * from activities where act_date = NOW() order by act_type_id; $getact=mysql_query($sqlact) What Im trying to do now is: From

Re: [PHP] while loop

2005-02-23 Thread Richard Lynch
Reinhart Viane wrote: Hey list I have a mysql table like this: Act_name Act_type_id Act_date Heyhey 1 22-06-05 Aloha2 22-06-05 Tralala 2 22-06-05 Wuhu1

Re: [PHP] while loop

2005-02-23 Thread Justin Lilly
Perhaps it is just me, but wouldn't it be easier to make individual mysql queries for each different act type? That would make the sorting -much- easier. I'm not sure if that's an option, but if it is, I'd consider exploring it. select * from activities where act_date = NOW() act_type_id = 1 or

RE: [PHP] while loop

2005-02-23 Thread Reinhart Viane
@lists.php.net Onderwerp: Re: [PHP] while loop Perhaps it is just me, but wouldn't it be easier to make individual mysql queries for each different act type? That would make the sorting -much- easier. I'm not sure if that's an option, but if it is, I'd consider exploring it. select * from activities

Re: [PHP] while loop

2005-02-23 Thread Marek Kilimajer
: Justin Lilly [mailto:[EMAIL PROTECTED] Verzonden: woensdag 23 februari 2005 18:57 Aan: php-general@lists.php.net Onderwerp: Re: [PHP] while loop Perhaps it is just me, but wouldn't it be easier to make individual mysql queries for each different act type? That would make the sorting -much- easier. I'm

Re: [PHP] while loop

2005-02-23 Thread Jochem Maas
Reinhart Viane wrote: Well I'm able to do that, there are only 4 different types, but the 4 queries have exactly the same syntax so I think it's better to combine them. Not? what about using UNION on the four queries? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] while inside a function

2004-12-05 Thread Raditha Dissanayake
Louie Miranda wrote: i have a while statement inside a function, but it seems like it dont work. is this possible? Add the following lines: global $apo; global $row; This will make it work for you but it's not the best solution. It's better to pass in parameters to the function rather than to

Re: [PHP] while inside a function

2004-12-05 Thread Louie Miranda
sorry, i overlooked on something. i need to rest for a while, im working on a wrong program thats why it wont work. heh, :(. thanks again. -- Louie Miranda http://www.axishift.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] while inside a while or join or...

2004-05-16 Thread Rachel Rodriguez
I would like to select all 'b' from Table_1 WHERE a = '2' and then to select all 'd' from table_2 with 'b' from previous result. Table 2 is the Table with UserNames (d) and Table 1 is the table with 'marked' UserID's (b). If I understand you correctly, its sounds like you want to

Re: [PHP] while inside a while or join or...

2004-05-16 Thread Curt Zirzow
* Thus wrote T. H. Grejc ([EMAIL PROTECTED]): Hallo, I know of a few ways of doing this but I am not sure that any is right. I want to consult with you what is the best way of doing this: ... I would like to select all 'b' from Table_1 WHERE a = '2' and then to select all 'd' from

Re: [PHP] while inside a while or join or...

2004-05-16 Thread John W. Holmes
T. H. Grejc wrote: Hallo, I know of a few ways of doing this but I am not sure that any is right. I want to consult with you what is the best way of doing this: Table 1: ++-+ | *a* | *b* | ++-+ | 2 | 1| ++-+ | 2 | 2| ++-+ Table 2: ++-+ |

Re: [PHP] 'while' not picking up on first DB record

2003-09-17 Thread Miles Thompson
Please don't cross-post. See below - M. At 10:17 AM 9/17/2003 -0400, Roger Spears wrote: Hello, Can anyone from the lists please tell me why this bit of code is not picking up on the first record in the database? If the 'id' I'm looking for is '1' it doesn't populate the _SESSION variables.

Re: [PHP] while loop with mysql

2003-03-10 Thread Tom Rogers
Hi, Monday, March 10, 2003, 7:20:37 PM, you wrote: RK Can somebody look at this and tell me way the first while loop will RK only loop through the database once when there is more than one record RK that should be processed. RK while($members = @mysql_fetch_object($result)) { RK

RE: [PHP] while loop- will this work?

2003-01-30 Thread Matt Schroebel
-Original Message- From: SpyProductions Support Team [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 30, 2003 12:57 PM To: [EMAIL PROTECTED] Subject: [PHP] while loop- will this work? Should this work? $f1 = rand(999,999); while($check_sid =

RE: [PHP] while loop- will this work?

2003-01-30 Thread Roedel, Mark
-Original Message- From: SpyProductions Support Team [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 30, 2003 11:57 AM To: [EMAIL PROTECTED] Subject: [PHP] while loop- will this work? Should this work? Nope...because the value returned by mysql_query() isn't the number

Re: [PHP] WHILE IF/ELSE loop not working

2003-01-24 Thread Rick Emery
Define fails - Original Message - From: Jay Fitzgerald [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 24, 2003 3:11 PM Subject: [PHP] WHILE IF/ELSE loop not working can anyone tell me why this while loop fails? == while

Re: [PHP] WHILE IF/ELSE loop not working

2003-01-24 Thread Jason Wong
On Saturday 25 January 2003 05:43, Rick Emery wrote: Define fails - Original Message - From: Jay Fitzgerald [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 24, 2003 3:11 PM Subject: [PHP] WHILE IF/ELSE loop not working can anyone tell me why this while loop fails?

RE: [PHP] while...

2002-06-12 Thread Lazor, Ed
Why not use while to loop through the shopping cart and add items to the message variable? $message = Here is your order: ; while ($Row = mysql_fetch_array($Results)) $message .= item description information; $message .= Thanks for your order... ; -Original Message-

Re: [PHP] while loop question - problem (new set of eyes needed)

2002-05-20 Thread Rasmus Lerdorf
You are resetting $row inside your loop. Don't do that. On Sun, 19 May 2002, Lee P Reilly wrote: Hi, I wonder if someone could have a quick look at this for me? It's a simple while loop, but it's not acting the way (I think) it should. If I break down the while loop, it reads:

Re: [PHP] while loop question - problem (new set of eyes needed)

2002-05-19 Thread Julie Meloni
LPR LPR while($row = mysql_fetch_array($result)) LPR { LPR $pri = $row['pri']; LPR $fg = $row['fg']; LPR $molw = $row['molw']; LPR $density = $row['density']; LPR $denstype = $row['denstype']; LPR $pctd = $row['pctd']; LPR

RE: [PHP] while loop question - problem (new set of eyes needed)

2002-05-19 Thread Martin Towell
Line 13 is re-assigning $result, the save variable you're using in line 1! 1 while($row = mysql_fetch_array($result)) 2 { 3$pri = $row['pri']; 4$fg = $row['fg']; 5$molw = $row['molw']; 6$density = $row['density']; 7$denstype = $row['denstype']; 8$pctd =

RE: [PHP] while loop question - problem (new set of eyes needed)

2002-05-19 Thread David Freeman
while($row = mysql_fetch_array($result)) { So, your while loop is based on values of $row. $row = mysql_fetch_array($result); Now within your while loop you've altered the value of $row - poor thing is probably a tad confused. CYA, Dave -- PHP General Mailing List

Re: [PHP] while loop: detect next loop?

2002-03-28 Thread Tom Rogers
Hi add the newline and white space first like this $data_printed = ; while ($row = mysql_fetch_assoc($result)) { if($data_printed != ){ $data_printed .= \n; } $data_printed = file id=\ . $row['file_id'] . \ . $row['file_name'] . /file; } That will

Re: [PHP] while loop: detect next loop?

2002-03-27 Thread Erik Price
On Wednesday, March 27, 2002, at 04:11 PM, Matt Friedman wrote: When you have all your items in an array use implode to add a character in between every item. $str = implode($yourArray, $separator); This will add the separator to the end of each string except the last one. I like that

Re: [PHP] while loop: detect next loop?

2002-03-27 Thread Jason Wong
On Thursday 28 March 2002 05:20, Erik Price wrote: On Wednesday, March 27, 2002, at 04:11 PM, Matt Friedman wrote: When you have all your items in an array use implode to add a character in between every item. $str = implode($yourArray, $separator); This will add the separator to

Re: [PHP] While on array?

2002-01-21 Thread anders nawroth
ie - i have: while($myrow=mysql_fetch_array($result)) { etc... But i want the loop to run with an array i created earlier ($anotherarray = [key1] = value1, [key2] = value2). use foreach($anotherarray as $key = $value) { . A Nawroth -- PHP General Mailing List

Re: [PHP] While on array?

2002-01-20 Thread Bogdan Stancescu
You should probably take a look at each() for that... The functionality is not the same but it's the only answer I can think of for your question (i.e. mysql_fetch_row() _returns_ a key-value array while each() _walks_ a key-value array). Bogdan Daniel Alsén wrote: Hi, i am fiddling with a

Re: [PHP] while() looping over query results twice?

2001-10-25 Thread Mike Eheler
Trying using mysql_fetch_array, and using the field names. This is the recommended behaviour in PHP4: $result = mysql_query($myQuery) //$myQuery gets defined earlier $resultCount = mysql_num_rows($result); $companyID = array(); while($query_data =

Re: [PHP] while() looping over query results twice?

2001-10-25 Thread Jim Lucas
I notice that you are concatinating then each time. try setting them to = before using them $companyID_string = ; $companyName_string = ; then: while() { $companyID_string .= , . $query_data[0]; $companyName_string .= , . $query_data[1]; } Jim ps. try

Re: [PHP] while() looping over query results twice?

2001-10-25 Thread Kurt Lieber
OK, so I defined the variables before using them and that solved the problem. (Thanks!) I'm still curious as to why not defining them ahead of time would cause the data within each string to get duplicated. In other words, if the query results are a,b,c,d, then by not defining the variable

Re: [PHP] while() looping over query results twice?

2001-10-25 Thread Jim Lucas
[EMAIL PROTECTED] To: Jim Lucas [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, October 25, 2001 1:17 PM Subject: Re: [PHP] while() looping over query results twice? OK, so I defined the variables before using them and that solved the problem. (Thanks!) I'm still curious as to why

Re: [PHP] while() looping over query results twice?

2001-10-25 Thread Kurt Lieber
I don't think so, but if I have to suspect my code or a bug in php, I'll suspect my code. :) I did a quick if (isset($companyID_string)) { print true; } else { print false;} and that didn't turn up anything, but I didn't spend a whole lot of effort on it. Like I said, I'm pretty sure I

RE: [PHP] while loop with if statement - here's the attachment

2001-08-20 Thread sgibbs
Here's the attachment - I hate it when I do that! :) -Original Message- From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: 8/20/01 10:25 AM Subject: [PHP] while loop with if statement I can't figure out why the if statement isn't working. The page displays the same with or without

Re: [PHP] while loop with if statement - here's the attachment

2001-08-20 Thread Steve Brett
did you do it again ? :-) pasting you code is ok ... Steve [EMAIL PROTECTED] wrote in message BB6D932A42D6D211B4AC0090274EBB1D2EF0EE@GLOBAL1">news:BB6D932A42D6D211B4AC0090274EBB1D2EF0EE@GLOBAL1... Here's the attachment - I hate it when I do that! :) -Original Message- From:

RE: [PHP] while loop with if statement - here's the code

2001-08-20 Thread sgibbs
Thanks Steve! :) Here's the code: ? $results = mysql_db_query($db, select * from $table where $query order by update_datetime desc limit $offset, 10); while($one = mysql_fetch_array($results)){ $id=$one[id]; $title=$one[title]; $description=$one[description];

Re: [PHP] while loop with if statement - here's the code

2001-08-20 Thread Steve Brett
try using mysql_num_rows() to get the number of rows returned by the query. you need to supply it with the identifier for the query not the sql you sent to the query. not exactly sure what you're trying to do though ... Steve [EMAIL PROTECTED] wrote in message

Re: [PHP] while loop with if statement - here's the code

2001-08-20 Thread Steve Brett
okay - read all the code now. this might be a better way: ?php $results = mysql_db_query($db, select * from $table where $query order by update_datetime desc limit $offset, 10); $one = mysql_fetch_array($results); $numrows=mysql_num_rows($one);// get the number of results if ($numrows0)

RE: [PHP] while loop with if statement - here's the code

2001-08-20 Thread Alnisa Allgood
At 11:02 AM -0400 8/20/01, [EMAIL PROTECTED] wrote: ? $results = mysql_db_query($db, select * from $table where $query order by update_datetime desc limit $offset, 10); while($one = mysql_fetch_array($results)){ $id=$one[id]; $title=$one[title];

  1   2   >