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!)
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
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
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
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
::
:: 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
::
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
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
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
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
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
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
* 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
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
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
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:
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.
* 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
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 =
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
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
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
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
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
--- 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
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
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
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
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
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
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
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
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,
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
]]
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
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()
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
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:
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();
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 =
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
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
[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
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
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 =
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
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);
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", "*");
48 matches
Mail list logo