[PHP] databases, loops and tables oh my...

2006-02-23 Thread Jason Gerfen
Not sure about this one, I am trying to execute a SQL query to retrieve records then loop over the records and display X amount per line. Any help is appreciated. $sql = @mysql_query( SELECT * FROM subnets, $db ); $num = @mysql_num_rows( $sql ); $subnets .= table width=\100%\trtd

Re: [PHP] databases, loops and tables oh my...

2006-02-23 Thread Jochem Maas
Jason Gerfen wrote: Not sure about this one, I am trying to execute a SQL query to retrieve records then loop over the records and display X amount per line. Any X ammount of what per 'line'? db records (or elelphants)? and by line do you mean 'html table row'? assuming I got that correct,

[PHP] Re: Loops (Thank you very much!)

2004-12-14 Thread Steve Marquez
This is the code I went with and it works like a charm! Thank you very much M. Sokolewicz! echo {$row['name']}br /{$row['description']}; would work, just like all of the following would also: echo $row[name]br /$row[description]; echo $row['name'].br /.$row['description']; and a couple of others

[PHP] for loops performance

2004-08-21 Thread Xongoo!com: Central unit
Holla, Maybe someone knows how to improve for loops performance? When generating 1000's of pages, it oads in 10-20 seconds. Maybe there is some solution I don't know about? Thanks! -- Tadas Talaikis [EMAIL PROTECTED] http://www.xongoo.com -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] for loops performance

2004-08-21 Thread Robert Cummings
On Sat, 2004-08-21 at 12:17, Xongoo!com: Central unit wrote: Holla, Maybe someone knows how to improve for loops performance? When generating 1000's of pages, it oads in 10-20 seconds. Maybe there is some solution I don't know about? Give us an example of your for loop that is having

Re: [PHP] for loops performance

2004-08-21 Thread raditha dissanayake
Xongoo!com: Central unit wrote: Holla, Maybe someone knows how to improve for loops performance? When generating 1000's of pages, it oads in 10-20 seconds. Maybe there is some solution I don't know about? prey what is your algorithm? Thanks! -- Tadas Talaikis [EMAIL PROTECTED]

Re: [PHP] for loops performance

2004-08-21 Thread Xongoo!com: Central unit
: Central unit [EMAIL PROTECTED] Cc: PHP-General [EMAIL PROTECTED] Sent: Saturday, August 21, 2004 7:32 PM Subject: Re: [PHP] for loops performance On Sat, 2004-08-21 at 12:17, Xongoo!com: Central unit wrote: Holla, Maybe someone knows how to improve for loops performance? When generating 1000's

Re: [PHP] for loops performance

2004-08-21 Thread Shawn McKenzie
PROTECTED] To: Xongoo!com: Central unit [EMAIL PROTECTED] Cc: PHP-General [EMAIL PROTECTED] Sent: Saturday, August 21, 2004 7:32 PM Subject: Re: [PHP] for loops performance On Sat, 2004-08-21 at 12:17, Xongoo!com: Central unit wrote: Holla, Maybe someone knows how to improve for loops performance? When

Re: [PHP] for loops performance

2004-08-21 Thread John Holmes
Xongoo!com: Central unit wrote: Maybe someone knows how to improve for loops performance? When generating 1000's of pages, it oads in 10-20 seconds. Maybe there is some solution I don't know about? If you only generate 100s of pages, it'll probably load about ten times faster... -- ---John

[PHP] arrays, loops, vars and props

2004-03-10 Thread Jason Davidson
Hey, would anyone know offhand, if its faster to create a temp array, fill it via loop, and then set a class property to that array, or to simply fill the class property via loop.. to clearify. would the following example be faster or slower had i simply done $this-myArray[$i] = $i; class

RE: [PHP] arrays, loops, vars and props

2004-03-10 Thread Chris W. Parker
Jason Davidson mailto:[EMAIL PROTECTED] on Wednesday, March 10, 2004 12:25 AM said: would the following example be faster or slower had i simply done $this-myArray[$i] = $i; class MyClass { var $myArray = array(); function MyClass() { $myTempArray = array();

Re: [PHP] arrays, loops, vars and props

2004-03-10 Thread Luis Mirabal
i would do it this way function MyClass() { $this-myArray = range(0, 99); } luis. Chris W. Parker [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Jason Davidson mailto:[EMAIL PROTECTED] on Wednesday, March 10, 2004 12:25 AM said: would the following example be faster

RE: [PHP] arrays, loops, vars and props

2004-03-10 Thread Michal Migurski
here's how i would do it (coding styles aside): function MyClass() { $limit = 100; $i = -1; while(++$i $limit) { $this-myArray[] = $i; } } Don't forget poor old range: $this-myArray = range(0, 99);

RE: [PHP] arrays, loops, vars and props

2004-03-10 Thread Chris W. Parker
Luis Mirabal mailto:[EMAIL PROTECTED] on Wednesday, March 10, 2004 12:30 PM said: i would do it this way function MyClass() { $this-myArray = range(0, 99); } guys (luis), guys (mike), let's not try to one-up each other... ... ... but i would take it a step further. :P function

RE: [PHP] arrays, loops, vars and props

2004-03-10 Thread Jason Davidson
Im fully aware of diffrent ways of doing it, my question is, in the 2 ways i mentioned, which is more efficient. Ill take the question to the internals list. Thanks for your responses. Jason Chris W. Parker [EMAIL PROTECTED] wrote: Luis Mirabal mailto:[EMAIL PROTECTED] on Wednesday,

RE: [PHP] Nested Loops

2004-02-19 Thread Ford, Mike [LSS]
On 18 February 2004 22:13, Alex Hogan wrote: Sorry..., Line 17 is: print trtda href=\$id\$row2[$rtxt]/a/td/tr; I haven't a clue what this is relating to (bit *too* much snippage there!), but I think that statement is going to need some curly braces to have a chance of working as

RE: [PHP] Nested Loops

2004-02-19 Thread Alex Hogan
Message- From: Ford, Mike [LSS] [mailto:[EMAIL PROTECTED] Sent: Thursday, February 19, 2004 4:50 AM To: 'Alex Hogan'; PHP General list Subject: RE: [PHP] Nested Loops On 18 February 2004 22:13, Alex Hogan wrote: Sorry..., Line 17 is: print trtda href=\$id\$row2[$rtxt]/a/td/tr

[PHP] Nested Loops

2004-02-18 Thread Alex Hogan
Hi All, I've been banging my head for several hours now. I've got a mssql backend. What I want to display is; Date 1 Item 1 Item 2 Item 3 ... etc Date 2 Item 1 Item 2 Item 3 ... etc Here's the code I've been fighting with; $query = select distinct wn_pdate

[PHP] Nested Loops

2004-02-18 Thread Alex Hogan
Sorry..., Line 17 is: print trtda href=\$id\$row2[$rtxt]/a/td/tr; alex ** The contents of this e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity

RE: [PHP] Nested Loops

2004-02-18 Thread Chris W. Parker
Alex Hogan mailto:[EMAIL PROTECTED] on Wednesday, February 18, 2004 2:06 PM said: Do I have something wrong with my syntax? Is there an easier way to do this? i don't know the answer to either of those questions but if it's complaining of an undefined index you might want to try

RE: [PHP] Nested Loops

2004-02-18 Thread Alex Hogan
Using print_r($var) shows that the vars are returning the right values, and where they're supposed to. Right in between the error messages. Doh. alex ** The contents of this e-mail and any files transmitted with it are

RE: [PHP] For Loops and Variables??

2003-09-16 Thread Chris W. Parker
John Ryan mailto:[EMAIL PROTECTED] on Saturday, September 13, 2003 9:26 AM said: When I use for loops, at the start of each iteration, the variables hold the values from the last loop. You're doing it wrong then (I think). 1. You should always initialize your loop counters. i.e. $x = 0;

RE: [PHP] For Loops and Variables??

2003-09-16 Thread Chris W. Parker
Chris W. Parker on Tuesday, September 16, 2003 4:07 PM said: This Is Good(tm): for($x=0;$x100;$x++) { for($x=0;$x100;$x++) { echo Me happy now!!; } } Hehe... whoops! Should be: for($x=0;$x100;$x++) { for($y=0;$y100;$y++) {

[PHP] For Loops and Variables??

2003-09-13 Thread John Ryan
When I use for loops, at the start of each iteration, the variables hold the values from the last loop. First, is there an elegant way of clearing variables at the start of each loop rather than using unset???! It just seems wrong. Also, all my problems would be solved if variables in a for loop

Re: [PHP] For Loops and Variables??

2003-09-13 Thread Curt Zirzow
* Thus wrote John Ryan ([EMAIL PROTECTED]): When I use for loops, at the start of each iteration, the variables hold the values from the last loop. First, is there an elegant way of clearing variables at the start of each loop rather than using unset???! It just seems wrong. I'm unclear as

Re: [PHP] infinate loops

2002-10-31 Thread Marek Kilimajer
where is $row['BillPeriod'] set? and what is its value? Chris Knipe wrote: Lo, Quite desperate now... Or at least, I'm starting to get there... Can anyone perhaps see why this loop is not exiting??? $quit=$now; $glet=getdate($row['RenewDate']); // debug echo howlong: . $howlong;

[PHP] infinate loops

2002-10-30 Thread Chris Knipe
Lo, Quite desperate now... Or at least, I'm starting to get there... Can anyone perhaps see why this loop is not exiting??? $quit=$now; $glet=getdate($row['RenewDate']); // debug echo howlong: . $howlong; while($quit$howlong) { // debug echo quit: . $quit . br; $quit=mktime(0, 0, 0,

Re: [PHP] for loops

2002-05-30 Thread Steve Buehler
it works for me just the way you have itexcept of course that you are telling it to only print to y because you are saying z Steve At 12:50 PM 5/30/2002 +0800, Jason Wong wrote: On Thursday 30 May 2002 11:46, Peter wrote: Just a query ... has any one else noticed this for($i = a; $i

[PHP] for loops

2002-05-29 Thread Peter
Just a query ... has any one else noticed this for($i = a; $i z; $i++) { print $i; echo BR;} will print out a right down to yz but replace the letters with numbers eg for($i = 1; $i 10; $i++) { print $i; echo BR;} and it prints 1 thru to 10 and any one know a reason for this?

Re: [PHP] for loops

2002-05-29 Thread Jason Wong
On Thursday 30 May 2002 11:46, Peter wrote: Just a query ... has any one else noticed this for($i = a; $i z; $i++) { print $i; echo BR;} will print out a right down to yz It should only print to 'y' ... but replace the letters with numbers eg for($i = 1; $i 10; $i++) { print

[PHP] Re: mysql php - while loops

2002-02-28 Thread bill
Keep track of rows, and add images at rows 4 8. See below Craig Westerman wrote: The following lists 12 items from a fruits table. $results = mysql_query(SELECT ID, date, appleprice, orangeprice, pearprice FROM fruits); $x=1; while ($data = mysql_fetch_array($results)) { ?

RE: [PHP] mysql php - while loops

2002-02-27 Thread Stewart G.
:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 11:43 AM To: php-general-list Subject: [PHP] mysql php - while loops The following lists 12 items from a fruits table. $results = mysql_query(SELECT ID, date, appleprice, orangeprice, pearprice FROM fruits); while ($data

RE: [PHP] mysql php - while loops

2002-02-27 Thread Craig Westerman
'; php-general-list Subject: RE: [PHP] mysql php - while loops with a bit of cheating... use a table... (nb: this code not tested, but logic has) table ? $results = mysql_query(SELECT ID, date, appleprice, orangeprice, pearprice FROM fruits); $i = 0; $cols = 4 while ($data = mysql_fetch_array

[PHP] mysql php - while loops

2002-02-26 Thread Craig Westerman
The following lists 12 items from a fruits table. $results = mysql_query(SELECT ID, date, appleprice, orangeprice, pearprice FROM fruits); while ($data = mysql_fetch_array($results)) { ? p?=$data[date]? - ?=$data[appleprice]? - ?=$data[orangeprice]? - ?=$data[pearprice]?/p ? } How would I

RE: [PHP] mysql php - while loops

2002-02-26 Thread Martin Towell
]? - ?=$data[appleprice]?br ?=$data[orangeprice]? - ?=$data[pearprice]?/td ? if ($i % $cols == $cols-1) echo /tr; $i++; } ? /table -Original Message- From: Craig Westerman [mailto:[EMAIL PROTECTED]] Sent: Wednesday, February 27, 2002 11:43 AM To: php-general-list Subject: [PHP] mysql php

[PHP] while loops [ newbie ]

2001-05-17 Thread charles
be forewarned that a bash fan is writing this message with little to no perl/c++ experience. i have a file $file that is full of usernames and descriptions, one per line. i have another variable $username that i would like to compare against each line in the file and remove the line that matches

Re: [PHP] while loops [ newbie ]

2001-05-17 Thread Christian Reiniger
On Thursday 17 May 2001 13:58, [EMAIL PROTECTED] wrote: i would think that a while loop could do this and possibly write the output, minus the line i want to take away to a temp file and then copy it over. in bash i would use a statement like: while read i; do blah done $filename

Re: [PHP] while loops [ newbie ]

2001-05-17 Thread Steve Werby
[EMAIL PROTECTED] wrote: i have a file $file that is full of usernames and descriptions, one per line. i have another variable $username that i would like to compare against each line in the file and remove the line that matches the username field identically. $filename charles routers

Re: [PHP] nested loops and PHPLIB templates

2001-04-09 Thread Maxim Derkachev
Hello paula, Monday, April 09, 2001, 6:47:21 AM, you wrote: p I was sending desperate emails to this list related to nested loops and array comparision. p Well, just let you know that the problem seems to be that I'm using this with PHPLIB p templates and those can't handle nested loops.

[PHP] nested loops and PHPLIB templates

2001-04-08 Thread paula
I was sending desperate emails to this list related to nested loops and array comparision. Well, just let you know that the problem seems to be that I'm using this with PHPLIB templates and those can't handle nested loops. If I would know that a week ago I would avoid nightmares and had 6

Re: [PHP] nested loops and PHPLIB templates

2001-04-08 Thread eschmid+sic
On Sun, Apr 08, 2001 at 10:47:21PM -0400, paula wrote: I was sending desperate emails to this list related to nested loops and array comparision. Well, just let you know that the problem seems to be that I'm using this with PHPLIB templates and those can't handle nested loops. Please