Re: [PHP] Loops inside of a loop

2005-07-06 Thread Richard Lynch
On Wed, July 6, 2005 10:14 am, Moises Zaragoza said: > I was trying to get a MySQL Loop to run in side of a loop but I have to > reset the MySQL Pointer so that It can start again for as long as my loops > goes on. http://php.net/mysql_data_seek -- Like Music? http://l-i-e.com/artists.htm -- P

RE: [PHP] Loops inside of a loop

2005-07-06 Thread Jay Blanchard
[snip] I was trying to get a MySQL Loop to run in side of a loop but I have to reset the MySQL Pointer so that It can start again for as long as my loops goes on. [/snip] Can we see some of your code , that way we may be able to help. -- PHP General Mailing List (http://www.php.net/) To unsubscr

[PHP] Loops inside of a loop

2005-07-06 Thread Moises Zaragoza
Hey, My name is Moises Zaragoza I was trying to get a MySQL Loop to run in side of a loop but I have to reset the MySQL Pointer so that It can start again for as long as my loops goes on. Thanks For Samples of Web sites, Games, and resume please visit http://moiseszaragoza.com

Re: [PHP] Loops

2004-12-14 Thread Richard Lynch
>> //Untested code. >> $connection = @mysql_connect('localhost', 'USERNAME', 'PASSWORD') or >> trigger_error(@mysql_error() . " connecting to mysql", E_USER_ERROR); > mysql_error() *never* returns warnings... so why are you prepending an @ ? If $connection is an invalid link, it most certainly doe

Re: [PHP] Loops

2004-12-14 Thread M. Sokolewicz
Richard Davey wrote: Hello Steve, Tuesday, December 14, 2004, 3:52:26 PM, you wrote: SM> I would like to loop the multiple variables rather than put all the SM> variables into a single variable with an array. I can not figure out how to SM> do this. I assume you have placed the MySQL query and chec

[PHP] Loops

2004-12-14 Thread Steve Marquez
Greetings. I am trying to display looped information from a MySQL database in a PHP file. Loop $name (witht a br />) then $description End of loop I would like to loop the multiple variables rather than put all the variables into a single variable with an array. I can not figure out how to do

Re: [PHP] Loops

2004-12-14 Thread M. Sokolewicz
Richard Lynch wrote: Steve Marquez wrote: Greetings. I am trying to display looped information from a MySQL database in a PHP file. Loop $name (witht a br />) then $description End of loop I would like to loop the multiple variables rather than put all the variables into a single variable with an a

Re: [PHP] Loops

2004-12-14 Thread Richard Davey
Hello Steve, Tuesday, December 14, 2004, 3:52:26 PM, you wrote: SM> I would like to loop the multiple variables rather than put all the SM> variables into a single variable with an array. I can not figure out how to SM> do this. I assume you have placed the MySQL query and checked the number of

Re: [PHP] Loops

2004-12-14 Thread M. Sokolewicz
Gareth Williams wrote: $result = mysql_query("SELECT name, description FROM table"); while ($row = mysql_fetch_assoc($result)) { echo "{$row['name']}$row['description']"; that will throw errors. echo "{$row['name']}{$row['description']}"; would work, just like all of the following would also: e

Re: [PHP] Loops

2004-12-14 Thread Richard Lynch
Steve Marquez wrote: > Greetings. I am trying to display looped information from a MySQL database > in a PHP file. > > Loop > > $name (witht a br />) then > $description > > End of loop > > I would like to loop the multiple variables rather than put all the > variables into a single variable wi

Re: [PHP] Loops

2004-12-14 Thread Gareth Williams
$result = mysql_query("SELECT name, description FROM table"); while ($row = mysql_fetch_assoc($result)) { echo "{$row['name']}$row['description']"; } On 14 Dec 2004, at 16:52, Steve Marquez wrote: Greetings. I am trying to display looped information from a MySQL database in a PHP file. Lo

Re: [PHP] What's faster? MySQL Queries or PHP Loops? OT

2004-09-08 Thread Jim Grill
> That brings up another question which I know actually belongs over on the > MySQL board, but since the question arose here I thought I'd post here. I > understood that MyISAM tables could not be relational. Do you mean that I > can create JOINs between MyISAM tables? Maybe I need to do some more

Re: [PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread Greg Donald
On Wed, 2004-09-08 at 13:31, Robb Kerr wrote: > That brings up another question which I know actually belongs over on the > MySQL board, but since the question arose here I thought I'd post here. I > understood that MyISAM tables could not be relational. Do you mean that I > can create JOINs betwee

Re: [PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread John Holmes
From: "Robb Kerr" <[EMAIL PROTECTED]> That brings up another question which I know actually belongs over on the MySQL board, but since the question arose here I thought I'd post here. I understood that MyISAM tables could not be relational. Do you mean that I can create JOINs between MyISAM tables?

RE: [PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread Jay Blanchard
[snip] That brings up another question which I know actually belongs over on the MySQL board, but since the question arose here I thought I'd post here. I understood that MyISAM tables could not be relational. Do you mean that I can create JOINs between MyISAM tables? Maybe I need to do some more r

RE: [PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread Jay Blanchard
[snip] I don't completely understand your terminology, but it's always faster to get all of your data with a single query rather than a query per loop. Of course, the difference is that it also requires more memory. In general, if you have the memory, use it. It will always be faster. [/snip] +1

Re: [PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread Robb Kerr
On Wed, 8 Sep 2004 10:30:59 -0500, Jim Grill wrote: >> Here's the question... >> >> I can either A) in the header or my page, generate a recordset of all of >> the records in the related table and then loop through the recordset >> creating an array of the fields I need and then later pull from it

Re: [PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread Galen
Almost all the time (unless the data being worked with is extremely, extremely large) PHP is much faster at manipulating data than MySQL. So if you already have the record set pulled out of MySQL, you probably want to go with PHP to manipulate it. Especially for repeating like this, there is ze

Re: [PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread Chris Shiflett
--- Robb Kerr <[EMAIL PROTECTED]> wrote: > Here's the question... > > I can either A) in the header or my page, generate a recordset > of all of the records in the related table and then loop through > the recordset creating an array of the fields I need and then > later pull from it in the repeat

RE: [PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread Dan Joseph
> I can either A) in the header or my page, generate a recordset of all of > the records in the related table and then loop through the recordset > creating an array of the fields I need and then later pull from it in the > repeat region... or B) take the six lines of code Dreamweaver generates to

Re: [PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread Jim Grill
> Here's the question... > > I can either A) in the header or my page, generate a recordset of all of > the records in the related table and then loop through the recordset > creating an array of the fields I need and then later pull from it in the > repeat region... or B) take the six lines of cod

[PHP] What's faster? MySQL Queries or PHP Loops?

2004-09-08 Thread Robb Kerr
Here's the scenario... First, my HTTP Server (Apache), PHP Server and MySQL Server are on the same machine - an Apple Xserve. Second, I've got a page with a long repeat region reflecting a recordset queried out of a MySQL table. The region also displays information obtained from fields in a re

Re: [PHP] Mysql query and PHP loops

2003-08-01 Thread Nicholas Robinson
On further reflection, my first attempt works for the specific example but may not in the general case. Try using a combination of max( ...id ) and min( ...val2 ) and add t1.val2 to the group by clause. This might work, but I've deleted my test files now! On Friday 01 Aug 2003 7:04 am, Nicholas

Re: [PHP] Mysql query and PHP loops

2003-07-31 Thread Nicholas Robinson
I think this does what you want. You can probably extend it to do the final check for val3 vs. val2 select distinct t1.val1, max( t1.id ), t1.val2 from table as t1, table as t2 where t1.val2 <= t2.val2 group by t1.val1; HTH On Thursday 31 Jul 2003 3:22 pm, Petre Agenbag wrote: > Hi List >

[PHP] Re: Mysql query and PHP loops

2003-07-31 Thread sven
did you also play with group by? what does this return? select * from `yourTable` group by `val1` ciao SVEN Petre Agenbag wrote: > Hi List > > I've been trying to do something with one MySQL query, but I don't > think it is possible, so, I would need to probably do multiple > queries, and possib

[PHP] Mysql query and PHP loops

2003-07-31 Thread Petre Agenbag
Hi List I've been trying to do something with one MySQL query, but I don't think it is possible, so, I would need to probably do multiple queries, and possibly have queries inside loops, but I am rather weary of that so, I'd like your views/possible solutions to doing the following: Consider thi

[PHP] loops with array_walk or foreach using array??? of variable pairs

2001-04-27 Thread Helmut Ott
I need to run the if-construct below (containing a number of variables in each "branch") using the 2 variables $table1 and $table2 in each run for each combination Is it array_walk or foreach ? (I "guess" that here I need a 2-dim-array, or so, passing always these 2 variables with each run: This