[PHP] Re: Looping from A to Z

2006-02-19 Thread Al
Richard K Miller wrote: Good afternoon. I'm having trouble getting PHP to loop from A through Z. Here is what I tried, coming from a C background: for ($l = A; $l = Z; $l++) echo $l; // Returns A, B, C, ..., X, Y, Z, AA, AB, AC, AD, AE, ... YX, YY, YZ. (26 * 26 results!)

[PHP] Re: looping through an array problem

2005-06-05 Thread M. Sokolewicz
Jack Jackson wrote: This is something dumb I am doing but: Trying to pull all names of publishers in db. This sql: SELECT art.art_id,art.publisher_id,publisher.publisher_name, FROM art LEFT JOIN publisher ON publisher.publisher_id=art.publisher_id pulls (in phpmyadmin) four rows: artID

Re: [PHP] Infinate looping

2004-09-21 Thread Chris Dowell
Are you by any chance doing something like this? while (1) { $dbh = mysql_connect(x, x, x); mysql_query(...); sleep(10); } If so, you could run into that maxclients problem very quickly because you're not closing those mysql connections (they'll time out eventually, and there are persistent

Re: [PHP] Infinate looping

2004-09-20 Thread Thomas Goyne
On Sun, 19 Sep 2004 11:20:01 -0500, Stephen Craton [EMAIL PROTECTED] wrote: Yes, I agree, if I were making a task to run every few minutes it would be easier, but that's not exactly what I'm doing. I'm more or less streaming content from the database to the end-user. It's basically a chat

Re: [PHP] Infinate looping

2004-09-19 Thread Andrew Kreps
On Sat, 18 Sep 2004 19:48:37 -0500, Stephen Craton [EMAIL PROTECTED] wrote: Here's what I'm doing in a nutshell: Loop infinitely, checking for changes to a database, flushing the data, sleep, and repeat the loop. It all goes well and I'm getting it to work correctly. However, I'm not sure on

RE: [PHP] Infinate looping

2004-09-19 Thread Stephen Craton
:: :: Personally, I think you're taking the wrong approach to solve your :: problem. PHP scripts were meant to execute in short fashion, to get :: over and done with. If you need something that checks for changes, :: don't make the PHP script run from now until doomsday, set it up as a ::

RE: [PHP] Infinate looping

2004-09-19 Thread Stephen Craton
i haven't paid a lot of attention to your setup. are you running this through your web server or via the php-cli? Basically I have a file that connects to a database, before the loop, and then checks the database for new messages. If there are, it displays them accordingly if via php through

[PHP] Infinate looping

2004-09-18 Thread Stephen Craton
Hello, I recently posted on the whole sleep() issue with max execution time thing but now I'm past that and actually concerned about webserver ability. Here's what I'm doing in a nutshell: Loop infinitely, checking for changes to a database, flushing the data, sleep, and repeat the loop. It all

[PHP] Socket looping challenge

2004-05-13 Thread René Fournier
Hi all, Still encountering some challenges with my socket loop. Basically, I need this socket client to wait to read incoming data, but if nothing happens for more than three seconds, I want it to do something, then return to waiting (for another three seconds). I've got some good help

Re: [PHP] Socket looping challenge

2004-05-13 Thread Tom Rogers
Hi, Friday, May 14, 2004, 5:21:10 AM, you wrote: RF Hi all, RF Still encountering some challenges with my socket loop. Basically, I RF need this socket client to wait to read incoming data, but if nothing RF happens for more than three seconds, I want it to do something, then RF return to

Re: [PHP] Socket looping challenge

2004-05-13 Thread René Fournier
The script doesn't even get that first while condition line. It loops a few times (while receiving messages), then when no more messages are coming from the server, and it times-out, it breaks out of the while, then returns to the top again, where it that while condition returns the error

Re[2]: [PHP] Socket looping challenge

2004-05-13 Thread Tom Rogers
Hi, Friday, May 14, 2004, 9:11:21 AM, you wrote: RF The script doesn't even get that first while condition line. It loops RF a few times (while receiving messages), then when no more messages are RF coming from the server, and it times-out, it breaks out of the while, RF then returns to the top

Re: [PHP] Socket looping challenge

2004-05-13 Thread Curt Zirzow
* Thus wrote Ren Fournier ([EMAIL PROTECTED]): MESSAGE RECEIVED PHP Warning: socket_read() unable to read from socket [35]: Resource temporarily unavailable in /Users/rene/Sites/gpspolice/titan/cr.php on line 61 This error [35] will occur if the socket isn't ready yet. Its an EAGAIN

[PHP] Mail looping

2003-09-20 Thread Ryan A
Hi, I am trying to make a tell a friend script, i am getting the emails from a textarea and am asking for this format [EMAIL PROTECTED],[EMAIL PROTECTED] etc in case the client forgets to put a comma or purposely then how do i check it? If anybody has any code samples or has already done that,I

[PHP] Re: Looping through a list - Newbie question

2003-08-27 Thread Jean-Christian IMbeault
explode() and then foreach are your friends :) explode() using the comma as your separator and then traverse the array using foreach. Jean-Christian Imbeault James Johnson wrote: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] array looping

2003-08-14 Thread Liam Gibbs
I get all the content of file, so everything is in array 0. I need to somehow break up the array by the comma. Wouldn't it be $file_contents = explode(,, $file_contents[0]); as in you've forgotten the array element? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] array looping

2003-08-14 Thread Micah Montoy
I have this text file that I pull in and I need to transverse through the file and assign each value in the file into an array. The text in the file is separated by a comma. I was thinking of something along the lines of explode but its only for strings and I couldn't get it to work with arrays.

Re: [PHP] problem looping through records

2003-08-14 Thread Curt Zirzow
* Thus wrote Huzz ([EMAIL PROTECTED]): I have a sql statement which brings about 15 records... inside the while loop i am trying to get data from another table by passing an id, the problem is i am only getting the first record .. not the whole 15 records.. any suggestion?? function

Re: [PHP] problem looping through records

2003-08-14 Thread John W. Holmes
Huzz wrote: I have a sql statement which brings about 15 records... inside the while loop i am trying to get data from another table by passing an id, the problem is i am only getting the first record .. not the whole 15 records.. any suggestion?? function list_ss_cats(){ global $db; $sql =

Re: [PHP] array looping

2003-08-14 Thread Micah Montoy
No, one long file. I can separate it out any way though. Any ideas? Chris W. Parker [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Micah Montoy mailto:[EMAIL PROTECTED] on Tuesday, August 12, 2003 3:35 PM said: I have this text file that I pull in and I need to transverse

RE: [PHP] array looping

2003-08-14 Thread Chris W. Parker
Micah Montoy mailto:[EMAIL PROTECTED] on Tuesday, August 12, 2003 3:35 PM said: I have this text file that I pull in and I need to transverse through the file and assign each value in the file into an array. Hehe... you mean traverse. Transverse: 1 : acting, lying, or being across : set

Re: [PHP] array looping

2003-08-14 Thread Micah Montoy
You where right. I realized this a bit after I posted. I got it going once I realized what I had forgotten. thanks everyone for your input Liam Gibbs [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I get all the content of file, so everything is in array 0. I need to somehow

Re: [PHP] array looping

2003-08-14 Thread Micah Montoy
When I tried the $file_contents = explode(,,$file_contents); I get the error: Notice: Array to string conversion in c:\inetpub\wwwroot\webpage10\example\search\dsp_search.php on line 111 When I do echo ($file_contents); the output is Array. When I do echo ($file_contents[0]); I get all

[PHP] problem looping through records

2003-08-14 Thread Huzz
I have a sql statement which brings about 15 records... inside the while loop i am trying to get data from another table by passing an id, the problem is i am only getting the first record .. not the whole 15 records.. any suggestion?? function list_ss_cats(){ global $db; $sql = SELECT

Re: [PHP] problem looping through records

2003-08-11 Thread Chris Shiflett
--- Huzz [EMAIL PROTECTED] wrote: I have a sql statement which brings about 15 records... inside the while loop i am trying to get data from another table by passing an id, the problem is i am only getting the first record .. not the whole 15 records.. The answer lies in your own code. You're

Re: [PHP] problem looping through records

2003-08-10 Thread David Otton
On Sun, 10 Aug 2003 22:11:09 +0100, you wrote: I have a sql statement which brings about 15 records... inside the while loop i am trying to get data from another table by passing an id, the problem is i am only getting the first record .. not the whole 15 records.. any suggestion?? function

[PHP] PHP + MySQL looping question

2002-12-12 Thread Mark McCulligh
I was wondering if there is a easy way to loop through the same SQL results many times. I have a for loop that loops 3 time. Each time I want to loop through the SQL result printing. The end result is printing the SQL results 3 times in a order. The problem is I have to reset the SQL result

Re: [PHP] PHP + MySQL looping question

2002-12-12 Thread Jason Wong
On Friday 13 December 2002 05:40, Mark McCulligh wrote: I was wondering if there is a easy way to loop through the same SQL results many times. I have a for loop that loops 3 time. Each time I want to loop through the SQL result printing. The end result is printing the SQL results 3 times

Re: [PHP] PHP + MySQL looping question

2002-12-12 Thread bbonkosk
Mark, Try looking at : http://www.php.net/manual/en/function.mysql-data-seek.php and see if that function gives you the desired result. HTH -Brad I was wondering if there is a easy way to loop through the same SQL results many times. I have a for loop that loops 3 time. Each time I want to

RE: [PHP] PHP + MySQL looping question

2002-12-12 Thread Craig Thomas
The problem is I have to reset the SQL result array on each for loop. How do you do that? $myNewArrayFullofSqlResultsThatICanLoopOverAsManyTimesAsIWant = mysql_query($sql); -Craig -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP + MySQL looping question

2002-12-12 Thread Mark McCulligh
If I understand you if you use the mysql_query($sql) again won't it rerun my SQL again, not just reprint. Example: $result = mysql_query($sql); for ($i = 1; $i = 3; $i++) { while ($row = mysql_fetch_array($result)) { //Some Code echo $row['filed']; } //Reset result

RE: [PHP] PHP + MySQL looping question

2002-12-12 Thread Craig Thomas
Set the new array before your for loops, then loop over the array. -Craig -Original Message- From: Mark McCulligh [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 4:56 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] PHP + MySQL looping question If I understand you if you use

[PHP] Re: looping through array with list()/each()

2002-09-25 Thread Erwin
Please cast an eye over the following code and output and tell me why $k and $v are not being set: Code: - $ser = array( 'first', 'second', 'third', 'fourth', 'fifth' ); reset($ser); while ( list($key, $val) = each($ser) ); { echo \$key = $key,

[PHP] ODBC looping on Linux

2002-05-23 Thread Nicola Delbono
hello I have some queries in a script on the following environment: Linux Debian Apache 1.3.19 Patched Ben Php 4.0.6 patched UnixODBC driver manager latest version (installed yesterday) freeTDS driver DMBS - MicrosoftSQL 7. I have a few queries: line 15 - connection string line 20: qry

RE: [PHP] Program Looping ?

2002-03-29 Thread Hunter, Ray
]] Sent: Thursday, March 28, 2002 11:56 PM To: [EMAIL PROTECTED] Subject: [PHP] Program Looping ? I've written a script that checks my email. However, when I run the script (from the command line) -- I want it to loop with a 5 minute delay and the ability to stop the program anytime

[PHP] Program Looping ?

2002-03-28 Thread Jason Caldwell
I've written a script that checks my email. However, when I run the script (from the command line) -- I want it to loop with a 5 minute delay and the ability to stop the program anytime by pressing a key on the keyboard (say) the ~ key. Anyone know how to do this? ? function check_mail()

RE: [PHP] Program Looping ?

2002-03-28 Thread Demitrious S. Kelly
it to stop.. and make it if (is_file($file)) { $loop=0; } That's my opinion -Original Message- From: Jason Caldwell [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 28, 2002 10:56 PM To: [EMAIL PROTECTED] Subject: [PHP] Program Looping ? I've written a script that checks my email. However

[PHP] Re: Looping?

2001-12-14 Thread Tony Arnold
Thank you all for very good and quick answers. They did help! :-) / Tony... Tony Arnold [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello, I don't know if I'm in the right newsgroup but I'll give it a try... :-) How can I make the following work:

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

2001-10-25 Thread Kurt Lieber
I'm executing a query that returns some a UID and a company name. I'm using the following code to loop over that query result set: $result = mysql_query($myQuery) //$myQuery gets defined earlier $resultCount = mysql_num_rows($result); $companyID = array();

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
using the mysql_fetch_array() and calling to the vars as $query_data[col_name] instead. - Original Message - From: Kurt Lieber [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, October 25, 2001 12:51 PM Subject: [PHP] while() looping over query results twice? I'm executing

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

[PHP] sql looping problem??

2001-04-03 Thread Wade Halsey
Hi I have the following code /*number of times to run*/ $NumCases = $HTTP_POST_VARS['txtNumCases']; /*execute the sql*/ $sqlLargeRequest = sqlexecute($LargeRequest); for ($val = 0; $val $NumCases; ++$val){ if ($val $NumCases) { $details = sqlFetchObject( $sqlLargeRequest ); $AccNo =

Re: [PHP] sql looping problem??

2001-04-03 Thread Plutarck
It's probably not the cause of your problem (I know little to nothing about Interbase), but why the if... loop in your code? Your if: if ($val $NumCases) does the same thing as your for: for ($val = 0; $val $NumCases; ++$val) Unless of course you wanted it that way... -- Plutarck

[PHP] Not Looping...

2001-03-14 Thread WreckRman2
I am having problems figuring out how to loop to show more then one record... Any help would be great... All I can get is the first record... Thanks... Code: ?php $db = mysql_connect("localhost", "root", "*"); mysql_select_db("indywebdesign",$db);

Re: [PHP] Not Looping...

2001-03-14 Thread David Robley
On Thu, 15 Mar 2001 17:48, WreckRman2 wrote: I am having problems figuring out how to loop to show more then one record... Any help would be great... All I can get is the first record... Thanks... Code: ?php $db = mysql_connect("localhost", "root", "*");