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: http://www.php.net/unsub.php



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 webserver or php environment is probably terminating the script. It will
only run for the max number of seconds set in your php.ini file.

Arno


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] for loop problem

2002-03-20 Thread cal

Try this:

If ($button != )
{
$t = mysql_query(SELECT * from AddExisting);
$number_of_customers = mysql_num_rows($t);

for($i=0; $i$number_of_customers;$i++)
{
$r = mysql_fetch_array($t);
$email = $r[EMAIL_ADDRESS];
$cusname = $r[Name];

$originalMessage = $message
$to = $email;
$subject = hello;
$message = Dear $cusname,.$originalMessage;
$fromaddress = [EMAIL PROTECTED];

mail($to, $subject, $message, $fromaddress);
}//end of for
}//end of if

*
* Cal Evans
* Techno-Mage
* http://www.calevans.com
*

- Original Message -
From: Kris Vose [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 20, 2002 2:07 PM
Subject: [PHP] for loop problem


I have a problem with a piece of code that uses the mail function in a for
loop.  It sends out mail to all the users in the database but it has a
problem with attaching their specific name into the message.  What happens
is the first user in the database will get their name in the e-mail (Dear
John,).  Then the second user in the database will get the last users name
and their name in the e-mail (Dear John, Dear Mike) ...and so on and so
forth.

How do I fix this problem?  Your help is appreciated.

Here is the code:

If ($button != )
{
$t = mysql_query(SELECT * from AddExisting);
$number_of_customers = mysql_num_rows($t);

for($i=0; $i$number_of_customers;$i++)
{
$r = mysql_fetch_array($t);
$email = $r[EMAIL_ADDRESS];
$cusname = $r[Name];

$to = $email;
$subject = hello;
$message = Dear $cusname,.$message;
$fromaddress = [EMAIL PROTECTED];

mail($to, $subject, $message, $fromaddress);
}//end of for
}//end of if




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] for loop problem

2002-03-20 Thread cal

Opps, last messages had the definition of $originalMessage in the wrong
place.  Try this:
If ($button != )
{
$t = mysql_query(SELECT * from AddExisting);
$number_of_customers = mysql_num_rows($t);

$originalMessage = $message;

for($i=0; $i$number_of_customers;$i++)
{
$r = mysql_fetch_array($t);
$email = $r[EMAIL_ADDRESS];
$cusname = $r[Name];

$to = $email;
$subject = hello;
$message = Dear $cusname,.$originalMessage;
$fromaddress = [EMAIL PROTECTED];

mail($to, $subject, $message, $fromaddress);
}//end of for
}//end of if

*
* Cal Evans
* Techno-Mage
* http://www.calevans.com
*

- Original Message -
From: Kris Vose [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, March 20, 2002 2:07 PM
Subject: [PHP] for loop problem


I have a problem with a piece of code that uses the mail function in a for
loop.  It sends out mail to all the users in the database but it has a
problem with attaching their specific name into the message.  What happens
is the first user in the database will get their name in the e-mail (Dear
John,).  Then the second user in the database will get the last users name
and their name in the e-mail (Dear John, Dear Mike) ...and so on and so
forth.

How do I fix this problem?  Your help is appreciated.

Here is the code:

If ($button != )
{
$t = mysql_query(SELECT * from AddExisting);
$number_of_customers = mysql_num_rows($t);

for($i=0; $i$number_of_customers;$i++)
{
$r = mysql_fetch_array($t);
$email = $r[EMAIL_ADDRESS];
$cusname = $r[Name];

$to = $email;
$subject = hello;
$message = Dear $cusname,.$message;
$fromaddress = [EMAIL PROTECTED];

mail($to, $subject, $message, $fromaddress);
}//end of for
}//end of if




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] for loop problem

2002-03-20 Thread Miguel Cruz

On Wed, 20 Mar 2002, Kris Vose wrote:
 I have a problem with a piece of code that uses the mail function in a
 for loop.  It sends out mail to all the users in the database but it has
 a problem with attaching their specific name into the message.  What
 happens is the first user in the database will get their name in the
 e-mail (Dear John,).  Then the second user in the database will get the
 last users name and their name in the e-mail (Dear John, Dear Mike)
 ...and so on and so forth.
  
 If ($button != )
 {
 $t = mysql_query(SELECT * from AddExisting);
 $number_of_customers = mysql_num_rows($t);
 
 for($i=0; $i$number_of_customers;$i++)
 {
 $r = mysql_fetch_array($t);
 $email = $r[EMAIL_ADDRESS];
 $cusname = $r[Name];
 
 $to = $email;
 $subject = hello;
 $message = Dear $cusname,.$message;
 $fromaddress = [EMAIL PROTECTED];
 
 mail($to, $subject, $message, $fromaddress);
 }//end of for
 }//end of if

You don't need a for loop here; you don't actually care specifically how
many customers there are, just that you iterate once for each one. And
you've put a raw email address in the extra headers argument to mail()
rather than a properly-formed From: header.

Here's the code you want:

if (!empty(button))
{
  $t = mysql_query(SELECT * from AddExisting);
  while ($r = mysql_fetch_assoc($t))
  {
$message = Dear {$r[name]},\n{$message};
mail ($r[email_address], 'hello', $message, 'From: [EMAIL PROTECTED]');
  }
}

miguel


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] for loop problem?

2001-11-13 Thread John Steele

Tyler,

  It must be something weird with your NT version of MySQL, you might try asking on 
the MySQL list, or checking the bug list on mysql.com.  I have an even older version 
here on 95, that doesn't display any of those problems.

  Here's the code I used with it's output (no duplicates, I checked).  Notice that I 
did have to change the CREATE TABLE to meet 3.21.29a-gamma restrictions.

  You might try changing the passcode to an int, and tacking the 'P' on the front in 
your application.  Not sure if that's possible...

  John

?php /* testdb.php */

/*
Win95 OSR2, Xitami v2.4d6
PHP Version 4.0.2, Zend Engine v1.0.2, Zend Optimizer v0.99
MySQL Version: MySQL 3.21.29a-gamma
  MyISAM only - Max key length is 256 = 11 + 245

CREATE DATABASE testdb;

CREATE TABLE passcodes (
  id int(11) NOT NULL auto_increment,
  passcode varchar(255) NOT NULL default '',
  PRIMARY KEY (id),
  KEY idpass (id,passcode(245))
  );
*/

error_reporting(E_ALL);
set_time_limit (0);

if (!$connection = mysql_connect('localhost','root','*'))
  die (Can't connect to server: . mysql_error());

if (!$db = mysql_select_db('testdb', $connection))
  die (Can't select database testdb: . mysql_error());

if (!mysql_query(DELETE FROM passcodes))
  die ('Delete Failed: '. mysql_error());

$value1 = 100;
$value2 = 1223109;
for($i=$value1; $i=$value2; $i++) {
  if (!mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i')))
die (INSERT failed at $i: .mysql_error());
  }
echo 'INSERTs completed.brbr';

if (!$qid = mysql_query(SELECT id,passcode FROM passcodes ORDER BY passcode DESC 
LIMIT 10))
  die (SELECT failed: . mysql_error());

while ($arr = mysql_fetch_array($qid))
  echo $arr[0]: $arr[1]br\n;

if (!mysql_close($connection))
  die (Can't close connection: . mysql_error());
?

And it's output:

INSERTs completed.

223110: P1223109
223109: P1223108
223108: P1223107
223107: P1223106
223106: P1223105
223105: P1223104
223104: P1223103
223103: P1223102
223102: P1223101
223101: P1223100


Hi John,

MySQL Version: MySQL 3.23.44-nt

SQL:
CREATE TABLE passcodes (
  id int(11) NOT NULL auto_increment,
  passcode varchar(255) NOT NULL default '',
  PRIMARY KEY  (id),
  KEY id (id,passcode)
) TYPE=MyISAM;

I'm beginning to think it's a MySQL problem also because this PHP SHOULD
work.

Tyler

- Original Message -
From: John Steele [EMAIL PROTECTED]
To: PHP General List [EMAIL PROTECTED]
Sent: Monday, November 12, 2001 3:33 PM
Subject: Re: [PHP] for loop problem?


 Hi Tyler,

   This doesn't sound like a problem with PHP, but MySQL.  Can you show
your CREATE TABLE and MySQL version?

 John

 Hi Martin,
 
 I just got done doing that, and i got the same thing!  :-(
 
 Here's something interesting though.  There's an id field that's set to
 AUTO_INCREMENT.  I did a SELECT * FROM passcodes WHERE
passcode='P100'
 This gave me this:
 
 id | passcode
 ---
 1   |P100
 82145   |P100
 209398 |P100
 
 Shouldn't the ID's be further apart than that?  Know what I'm saying?
 
 Tyler
 
 - Original Message -
 From: Martin Towell [EMAIL PROTECTED]
 To: 'Tyler Longren' [EMAIL PROTECTED]; Jack Dempsey
 [EMAIL PROTECTED]
 Cc: PHP-General [EMAIL PROTECTED]
 Sent: Monday, November 12, 2001 10:45 PM
 Subject: RE: [PHP] for loop problem?
 
 
  How about changing the logic lightly? try this:
 
  $value1 = 0;
  $value2 = 223109;
  for($i=$value1; $i=$value2; $i++) {
   $tmp = sprintf(1%06d\n, $i);
   mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$tmp'));
 
  basically taking away 1,000,000 from the numbers then adding it back on
  later
 
  Martin T
 
  -Original Message-
  From: Tyler Longren [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, November 13, 2001 3:38 PM
  To: Jack Dempsey
  Cc: PHP-General
  Subject: Re: [PHP] for loop problem?
 
 
  I've ran it a few times without the MySQL code in there.  Runs just
fine
  that way for me too.  After it's run a few times for me (with the MySQL
  code), I start getting duplicate entries of codes in there.  For
example,
  I'll end up with a few 'P100' entries in the 'passcodes' field.
 
  Oh well, here I come perl!
 
  Thanks,
  Tyler
 
  - Original Message -
  From: Jack Dempsey [EMAIL PROTECTED]
  To: Tyler Longren [EMAIL PROTECTED];
[EMAIL PROTECTED]
  Sent: Monday, November 12, 2001 10:43 PM
  Subject: RE: [PHP] for loop problem?
 
 
   ran it (without mysql queries) and worked finereal strange.
   have you tried the loop without the mysql queries?
  
   -Original Message-
   From: Tyler Longren [mailto:[EMAIL PROTECTED]]
   Sent: Monday, November 12, 2001 11:28 PM
   To: Jack Dempsey; [EMAIL PROTECTED]
   Subject: Re: [PHP] for loop problem?
  
  
   Exact code:
   ?
   $connection = mysql_connect(host_here,user_here,pass_here);
   $db = mysql_select_db(db_here, $connection);
   $value1 = 100;
   $value2 = 1223109;
   for($i=$value1; $i=$value2; $i++) {
mysql_query(INSERT

Re: [PHP] for loop problem?

2001-11-13 Thread jimmy elab

Tyler Longren wrote:
 
 Here's something interesting though.  There's an id field that's set to
 AUTO_INCREMENT.  

Yep, and that's one thing I've been looking at. See, I find it strange
that you need an KEY idpass (id, passcode(245)) when the ID is
quaranteed to be unique in itself.

Funny... Would not explain why you get more, I'd rather expect you to
get fewer entries.

Anyway. Try this: Drop the passcode VARCHAR and make it fixed CHAR(10).
It seems like MySQL can't keep up with the speed of your inserts, and
varchar is obnoxiously slow.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] for loop problem?

2001-11-12 Thread Martin Towell

try removing the quotes and see if that works
eg
$value1 = 100;
becomes
$value1 = 100;

and
for($i=$value1; $i=$value2; $i++) {
becomes
for($i=$value1; $i=$value2; $i++) {

Martin T

-Original Message-
From: Tyler Longren [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 13, 2001 2:33 PM
To: PHP-General
Subject: [PHP] for loop problem?


Hello everyone,

I have a pretty big list of codes that need to be put into a mysql db.  The
numbers range from 100 to 1223109.  Here's the PHP I wrote to put these
codes into a database:

?
$connection = mysql_connect(blah,blah,blah);
$db = mysql_select_db(db_to_use, $connection);
$value1 = 100;
$value2 = 1223109;
for($i=$value1; $i=$value2; $i++) {
 mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
 if (mysql_error() != ) {
  print font face=Arial size=2.mysql_error()./font;
  exit;
 }
}
mysql_close($connection);
?

Everytime I run this from a browser, it just keeps looping.  It should put
about 223109 entries into the passcodes table.  However, it just keeps
looping.  I'll end up with 400,000 or so entries before I stop it.  I make
sure I empty that table before I start running it again.  Why is this
happening?

Thanks everyone,
Tyler


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



Re: [PHP] for loop problem?

2001-11-12 Thread Evan Nemerson

My word why all the quotes?

?
$connection = mysql_connect(blah,blah,blah);
$db = mysql_select_db(db_to_use, $connection);
$value1 = 100;
$value2 = 1223109;
for($i=$value1; $i=$value2; $i++) {
 mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
 if (mysql_error() != ) {
  print font face=Arial size=2.mysql_error()./font;
  exit;
 }
}
mysql_close($connection);
?

That should give you some better results.


On Monday 12 November 2001 07:32 pm, you wrote:
 Hello everyone,

 I have a pretty big list of codes that need to be put into a mysql db.  The
 numbers range from 100 to 1223109.  Here's the PHP I wrote to put these
 codes into a database:

 ?
 $connection = mysql_connect(blah,blah,blah);
 $db = mysql_select_db(db_to_use, $connection);
 $value1 = 100;
 $value2 = 1223109;
 for($i=$value1; $i=$value2; $i++) {
  mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
  if (mysql_error() != ) {
   print font face=Arial size=2.mysql_error()./font;
   exit;
  }
 }
 mysql_close($connection);
 ?

 Everytime I run this from a browser, it just keeps looping.  It should put
 about 223109 entries into the passcodes table.  However, it just keeps
 looping.  I'll end up with 400,000 or so entries before I stop it.  I make
 sure I empty that table before I start running it again.  Why is this
 happening?

 Thanks everyone,
 Tyler

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] for loop problem?

2001-11-12 Thread Tyler Longren

To everyone that said it had something to do with the quotes:
that has nothing to do with it.

When I first wrote this, It didn't have all the quotes.  It did the same
thing.  Then, I thought I may need some quotes somewhere, but that obviously
didn't help.  Any other suggestions?  If I HAVE to, I'll do this in PERL,
but would much rather do it in PHP.

Thanks everyone,
Tyler

- Original Message -
From: Evan Nemerson [EMAIL PROTECTED]
To: Tyler Longren [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, November 12, 2001 9:41 PM
Subject: Re: [PHP] for loop problem?


 My word why all the quotes?

 ?
 $connection = mysql_connect(blah,blah,blah);
 $db = mysql_select_db(db_to_use, $connection);
 $value1 = 100;
 $value2 = 1223109;
 for($i=$value1; $i=$value2; $i++) {
  mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
  if (mysql_error() != ) {
   print font face=Arial size=2.mysql_error()./font;
   exit;
  }
 }
 mysql_close($connection);
 ?

 That should give you some better results.


 On Monday 12 November 2001 07:32 pm, you wrote:
  Hello everyone,
 
  I have a pretty big list of codes that need to be put into a mysql db.
The
  numbers range from 100 to 1223109.  Here's the PHP I wrote to put
these
  codes into a database:
 
  ?
  $connection = mysql_connect(blah,blah,blah);
  $db = mysql_select_db(db_to_use, $connection);
  $value1 = 100;
  $value2 = 1223109;
  for($i=$value1; $i=$value2; $i++) {
   mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
   if (mysql_error() != ) {
print font face=Arial size=2.mysql_error()./font;
exit;
   }
  }
  mysql_close($connection);
  ?
 
  Everytime I run this from a browser, it just keeps looping.  It should
put
  about 223109 entries into the passcodes table.  However, it just keeps
  looping.  I'll end up with 400,000 or so entries before I stop it.  I
make
  sure I empty that table before I start running it again.  Why is this
  happening?
 
  Thanks everyone,
  Tyler

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] for loop problem?

2001-11-12 Thread Martin Towell

hmmm... I just tried :

$value1 = 100;
$value2 = 1223109;
for($i = $value1; $i = $value2; $i++)
{
  echo $i\n;
}

and it spat out all 223109 numbers (albiet after a VERY long time)
can't see how adding mysql code would affect the loop...

Martin T

-Original Message-
From: Tyler Longren [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 13, 2001 2:53 PM
To: Evan Nemerson; [EMAIL PROTECTED]
Subject: Re: [PHP] for loop problem?


To everyone that said it had something to do with the quotes:
that has nothing to do with it.

When I first wrote this, It didn't have all the quotes.  It did the same
thing.  Then, I thought I may need some quotes somewhere, but that obviously
didn't help.  Any other suggestions?  If I HAVE to, I'll do this in PERL,
but would much rather do it in PHP.

Thanks everyone,
Tyler

- Original Message -
From: Evan Nemerson [EMAIL PROTECTED]
To: Tyler Longren [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, November 12, 2001 9:41 PM
Subject: Re: [PHP] for loop problem?


 My word why all the quotes?

 ?
 $connection = mysql_connect(blah,blah,blah);
 $db = mysql_select_db(db_to_use, $connection);
 $value1 = 100;
 $value2 = 1223109;
 for($i=$value1; $i=$value2; $i++) {
  mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
  if (mysql_error() != ) {
   print font face=Arial size=2.mysql_error()./font;
   exit;
  }
 }
 mysql_close($connection);
 ?

 That should give you some better results.


 On Monday 12 November 2001 07:32 pm, you wrote:
  Hello everyone,
 
  I have a pretty big list of codes that need to be put into a mysql db.
The
  numbers range from 100 to 1223109.  Here's the PHP I wrote to put
these
  codes into a database:
 
  ?
  $connection = mysql_connect(blah,blah,blah);
  $db = mysql_select_db(db_to_use, $connection);
  $value1 = 100;
  $value2 = 1223109;
  for($i=$value1; $i=$value2; $i++) {
   mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
   if (mysql_error() != ) {
print font face=Arial size=2.mysql_error()./font;
exit;
   }
  }
  mysql_close($connection);
  ?
 
  Everytime I run this from a browser, it just keeps looping.  It should
put
  about 223109 entries into the passcodes table.  However, it just keeps
  looping.  I'll end up with 400,000 or so entries before I stop it.  I
make
  sure I empty that table before I start running it again.  Why is this
  happening?
 
  Thanks everyone,
  Tyler

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



Re: [PHP] for loop problem?

2001-11-12 Thread Tyler Longren

I removed all of the quotes that could be affecting it.  Still, it loops
until I stop it.  I let it go all the way up to 350,000 or so.  Any other
ideas anyone?

Thank you!
Tyler

- Original Message -
From: Martin Towell [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 12, 2001 10:06 PM
Subject: RE: [PHP] for loop problem?


 hmmm... I just tried :

 $value1 = 100;
 $value2 = 1223109;
 for($i = $value1; $i = $value2; $i++)
 {
   echo $i\n;
 }

 and it spat out all 223109 numbers (albiet after a VERY long time)
 can't see how adding mysql code would affect the loop...

 Martin T

 -Original Message-
 From: Tyler Longren [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, November 13, 2001 2:53 PM
 To: Evan Nemerson; [EMAIL PROTECTED]
 Subject: Re: [PHP] for loop problem?


 To everyone that said it had something to do with the quotes:
 that has nothing to do with it.

 When I first wrote this, It didn't have all the quotes.  It did the same
 thing.  Then, I thought I may need some quotes somewhere, but that
obviously
 didn't help.  Any other suggestions?  If I HAVE to, I'll do this in PERL,
 but would much rather do it in PHP.

 Thanks everyone,
 Tyler

 - Original Message -
 From: Evan Nemerson [EMAIL PROTECTED]
 To: Tyler Longren [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, November 12, 2001 9:41 PM
 Subject: Re: [PHP] for loop problem?


  My word why all the quotes?
 
  ?
  $connection = mysql_connect(blah,blah,blah);
  $db = mysql_select_db(db_to_use, $connection);
  $value1 = 100;
  $value2 = 1223109;
  for($i=$value1; $i=$value2; $i++) {
   mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
   if (mysql_error() != ) {
print font face=Arial size=2.mysql_error()./font;
exit;
   }
  }
  mysql_close($connection);
  ?
 
  That should give you some better results.
 
 
  On Monday 12 November 2001 07:32 pm, you wrote:
   Hello everyone,
  
   I have a pretty big list of codes that need to be put into a mysql db.
 The
   numbers range from 100 to 1223109.  Here's the PHP I wrote to put
 these
   codes into a database:
  
   ?
   $connection = mysql_connect(blah,blah,blah);
   $db = mysql_select_db(db_to_use, $connection);
   $value1 = 100;
   $value2 = 1223109;
   for($i=$value1; $i=$value2; $i++) {
mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
if (mysql_error() != ) {
 print font face=Arial size=2.mysql_error()./font;
 exit;
}
   }
   mysql_close($connection);
   ?
  
   Everytime I run this from a browser, it just keeps looping.  It should
 put
   about 223109 entries into the passcodes table.  However, it just
keeps
   looping.  I'll end up with 400,000 or so entries before I stop it.  I
 make
   sure I empty that table before I start running it again.  Why is this
   happening?
  
   Thanks everyone,
   Tyler
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] for loop problem?

2001-11-12 Thread Jack Dempsey

paste the complete code in and myself and others can run your exact copy

-Original Message-
From: Tyler Longren [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 12, 2001 11:22 PM
To: Martin Towell; [EMAIL PROTECTED]
Subject: Re: [PHP] for loop problem?


I removed all of the quotes that could be affecting it.  Still, it loops
until I stop it.  I let it go all the way up to 350,000 or so.  Any other
ideas anyone?

Thank you!
Tyler

- Original Message -
From: Martin Towell [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 12, 2001 10:06 PM
Subject: RE: [PHP] for loop problem?


 hmmm... I just tried :

 $value1 = 100;
 $value2 = 1223109;
 for($i = $value1; $i = $value2; $i++)
 {
   echo $i\n;
 }

 and it spat out all 223109 numbers (albiet after a VERY long time)
 can't see how adding mysql code would affect the loop...

 Martin T

 -Original Message-
 From: Tyler Longren [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, November 13, 2001 2:53 PM
 To: Evan Nemerson; [EMAIL PROTECTED]
 Subject: Re: [PHP] for loop problem?


 To everyone that said it had something to do with the quotes:
 that has nothing to do with it.

 When I first wrote this, It didn't have all the quotes.  It did the same
 thing.  Then, I thought I may need some quotes somewhere, but that
obviously
 didn't help.  Any other suggestions?  If I HAVE to, I'll do this in PERL,
 but would much rather do it in PHP.

 Thanks everyone,
 Tyler

 - Original Message -
 From: Evan Nemerson [EMAIL PROTECTED]
 To: Tyler Longren [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, November 12, 2001 9:41 PM
 Subject: Re: [PHP] for loop problem?


  My word why all the quotes?
 
  ?
  $connection = mysql_connect(blah,blah,blah);
  $db = mysql_select_db(db_to_use, $connection);
  $value1 = 100;
  $value2 = 1223109;
  for($i=$value1; $i=$value2; $i++) {
   mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
   if (mysql_error() != ) {
print font face=Arial size=2.mysql_error()./font;
exit;
   }
  }
  mysql_close($connection);
  ?
 
  That should give you some better results.
 
 
  On Monday 12 November 2001 07:32 pm, you wrote:
   Hello everyone,
  
   I have a pretty big list of codes that need to be put into a mysql db.
 The
   numbers range from 100 to 1223109.  Here's the PHP I wrote to put
 these
   codes into a database:
  
   ?
   $connection = mysql_connect(blah,blah,blah);
   $db = mysql_select_db(db_to_use, $connection);
   $value1 = 100;
   $value2 = 1223109;
   for($i=$value1; $i=$value2; $i++) {
mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
if (mysql_error() != ) {
 print font face=Arial size=2.mysql_error()./font;
 exit;
}
   }
   mysql_close($connection);
   ?
  
   Everytime I run this from a browser, it just keeps looping.  It should
 put
   about 223109 entries into the passcodes table.  However, it just
keeps
   looping.  I'll end up with 400,000 or so entries before I stop it.  I
 make
   sure I empty that table before I start running it again.  Why is this
   happening?
  
   Thanks everyone,
   Tyler
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] for loop problem?

2001-11-12 Thread Tyler Longren

Exact code:
?
$connection = mysql_connect(host_here,user_here,pass_here);
$db = mysql_select_db(db_here, $connection);
$value1 = 100;
$value2 = 1223109;
for($i=$value1; $i=$value2; $i++) {
 mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
 if (mysql_error() != ) {
  print font face=Arial size=2.mysql_error()./font;
  exit;
 }
}
mysql_close($connection);
?

Tyler

- Original Message -
From: Jack Dempsey [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 12, 2001 10:34 PM
Subject: RE: [PHP] for loop problem?


 paste the complete code in and myself and others can run your exact copy

 -Original Message-
 From: Tyler Longren [mailto:[EMAIL PROTECTED]]
 Sent: Monday, November 12, 2001 11:22 PM
 To: Martin Towell; [EMAIL PROTECTED]
 Subject: Re: [PHP] for loop problem?


 I removed all of the quotes that could be affecting it.  Still, it loops
 until I stop it.  I let it go all the way up to 350,000 or so.  Any other
 ideas anyone?

 Thank you!
 Tyler

 - Original Message -
 From: Martin Towell [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, November 12, 2001 10:06 PM
 Subject: RE: [PHP] for loop problem?


  hmmm... I just tried :
 
  $value1 = 100;
  $value2 = 1223109;
  for($i = $value1; $i = $value2; $i++)
  {
echo $i\n;
  }
 
  and it spat out all 223109 numbers (albiet after a VERY long time)
  can't see how adding mysql code would affect the loop...
 
  Martin T
 
  -Original Message-
  From: Tyler Longren [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, November 13, 2001 2:53 PM
  To: Evan Nemerson; [EMAIL PROTECTED]
  Subject: Re: [PHP] for loop problem?
 
 
  To everyone that said it had something to do with the quotes:
  that has nothing to do with it.
 
  When I first wrote this, It didn't have all the quotes.  It did the same
  thing.  Then, I thought I may need some quotes somewhere, but that
 obviously
  didn't help.  Any other suggestions?  If I HAVE to, I'll do this in
PERL,
  but would much rather do it in PHP.
 
  Thanks everyone,
  Tyler
 
  - Original Message -
  From: Evan Nemerson [EMAIL PROTECTED]
  To: Tyler Longren [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Monday, November 12, 2001 9:41 PM
  Subject: Re: [PHP] for loop problem?
 
 
   My word why all the quotes?
  
   ?
   $connection = mysql_connect(blah,blah,blah);
   $db = mysql_select_db(db_to_use, $connection);
   $value1 = 100;
   $value2 = 1223109;
   for($i=$value1; $i=$value2; $i++) {
mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
if (mysql_error() != ) {
 print font face=Arial size=2.mysql_error()./font;
 exit;
}
   }
   mysql_close($connection);
   ?
  
   That should give you some better results.
  
  
   On Monday 12 November 2001 07:32 pm, you wrote:
Hello everyone,
   
I have a pretty big list of codes that need to be put into a mysql
db.
  The
numbers range from 100 to 1223109.  Here's the PHP I wrote to
put
  these
codes into a database:
   
?
$connection = mysql_connect(blah,blah,blah);
$db = mysql_select_db(db_to_use, $connection);
$value1 = 100;
$value2 = 1223109;
for($i=$value1; $i=$value2; $i++) {
 mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
 if (mysql_error() != ) {
  print font face=Arial size=2.mysql_error()./font;
  exit;
 }
}
mysql_close($connection);
?
   
Everytime I run this from a browser, it just keeps looping.  It
should
  put
about 223109 entries into the passcodes table.  However, it just
 keeps
looping.  I'll end up with 400,000 or so entries before I stop it.
I
  make
sure I empty that table before I start running it again.  Why is
this
happening?
   
Thanks everyone,
Tyler
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
[EMAIL PROTECTED]
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] for loop problem?

2001-11-12 Thread Jack Dempsey

ran it (without mysql queries) and worked finereal strange.
have you tried the loop without the mysql queries?

-Original Message-
From: Tyler Longren [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 12, 2001 11:28 PM
To: Jack Dempsey; [EMAIL PROTECTED]
Subject: Re: [PHP] for loop problem?


Exact code:
?
$connection = mysql_connect(host_here,user_here,pass_here);
$db = mysql_select_db(db_here, $connection);
$value1 = 100;
$value2 = 1223109;
for($i=$value1; $i=$value2; $i++) {
 mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
 if (mysql_error() != ) {
  print font face=Arial size=2.mysql_error()./font;
  exit;
 }
}
mysql_close($connection);
?

Tyler

- Original Message -
From: Jack Dempsey [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 12, 2001 10:34 PM
Subject: RE: [PHP] for loop problem?


 paste the complete code in and myself and others can run your exact copy

 -Original Message-
 From: Tyler Longren [mailto:[EMAIL PROTECTED]]
 Sent: Monday, November 12, 2001 11:22 PM
 To: Martin Towell; [EMAIL PROTECTED]
 Subject: Re: [PHP] for loop problem?


 I removed all of the quotes that could be affecting it.  Still, it loops
 until I stop it.  I let it go all the way up to 350,000 or so.  Any other
 ideas anyone?

 Thank you!
 Tyler

 - Original Message -
 From: Martin Towell [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, November 12, 2001 10:06 PM
 Subject: RE: [PHP] for loop problem?


  hmmm... I just tried :
 
  $value1 = 100;
  $value2 = 1223109;
  for($i = $value1; $i = $value2; $i++)
  {
echo $i\n;
  }
 
  and it spat out all 223109 numbers (albiet after a VERY long time)
  can't see how adding mysql code would affect the loop...
 
  Martin T
 
  -Original Message-
  From: Tyler Longren [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, November 13, 2001 2:53 PM
  To: Evan Nemerson; [EMAIL PROTECTED]
  Subject: Re: [PHP] for loop problem?
 
 
  To everyone that said it had something to do with the quotes:
  that has nothing to do with it.
 
  When I first wrote this, It didn't have all the quotes.  It did the same
  thing.  Then, I thought I may need some quotes somewhere, but that
 obviously
  didn't help.  Any other suggestions?  If I HAVE to, I'll do this in
PERL,
  but would much rather do it in PHP.
 
  Thanks everyone,
  Tyler
 
  - Original Message -
  From: Evan Nemerson [EMAIL PROTECTED]
  To: Tyler Longren [EMAIL PROTECTED]; [EMAIL PROTECTED]
  Sent: Monday, November 12, 2001 9:41 PM
  Subject: Re: [PHP] for loop problem?
 
 
   My word why all the quotes?
  
   ?
   $connection = mysql_connect(blah,blah,blah);
   $db = mysql_select_db(db_to_use, $connection);
   $value1 = 100;
   $value2 = 1223109;
   for($i=$value1; $i=$value2; $i++) {
mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
if (mysql_error() != ) {
 print font face=Arial size=2.mysql_error()./font;
 exit;
}
   }
   mysql_close($connection);
   ?
  
   That should give you some better results.
  
  
   On Monday 12 November 2001 07:32 pm, you wrote:
Hello everyone,
   
I have a pretty big list of codes that need to be put into a mysql
db.
  The
numbers range from 100 to 1223109.  Here's the PHP I wrote to
put
  these
codes into a database:
   
?
$connection = mysql_connect(blah,blah,blah);
$db = mysql_select_db(db_to_use, $connection);
$value1 = 100;
$value2 = 1223109;
for($i=$value1; $i=$value2; $i++) {
 mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
 if (mysql_error() != ) {
  print font face=Arial size=2.mysql_error()./font;
  exit;
 }
}
mysql_close($connection);
?
   
Everytime I run this from a browser, it just keeps looping.  It
should
  put
about 223109 entries into the passcodes table.  However, it just
 keeps
looping.  I'll end up with 400,000 or so entries before I stop it.
I
  make
sure I empty that table before I start running it again.  Why is
this
happening?
   
Thanks everyone,
Tyler
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
   To contact the list administrators, e-mail:
[EMAIL PROTECTED]
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]
 


 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General

Re: [PHP] for loop problem?

2001-11-12 Thread Tyler Longren

I've ran it a few times without the MySQL code in there.  Runs just fine
that way for me too.  After it's run a few times for me (with the MySQL
code), I start getting duplicate entries of codes in there.  For example,
I'll end up with a few 'P100' entries in the 'passcodes' field.

Oh well, here I come perl!

Thanks,
Tyler

- Original Message -
From: Jack Dempsey [EMAIL PROTECTED]
To: Tyler Longren [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, November 12, 2001 10:43 PM
Subject: RE: [PHP] for loop problem?


 ran it (without mysql queries) and worked finereal strange.
 have you tried the loop without the mysql queries?

 -Original Message-
 From: Tyler Longren [mailto:[EMAIL PROTECTED]]
 Sent: Monday, November 12, 2001 11:28 PM
 To: Jack Dempsey; [EMAIL PROTECTED]
 Subject: Re: [PHP] for loop problem?


 Exact code:
 ?
 $connection = mysql_connect(host_here,user_here,pass_here);
 $db = mysql_select_db(db_here, $connection);
 $value1 = 100;
 $value2 = 1223109;
 for($i=$value1; $i=$value2; $i++) {
  mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
  if (mysql_error() != ) {
   print font face=Arial size=2.mysql_error()./font;
   exit;
  }
 }
 mysql_close($connection);
 ?

 Tyler

 - Original Message -
 From: Jack Dempsey [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, November 12, 2001 10:34 PM
 Subject: RE: [PHP] for loop problem?


  paste the complete code in and myself and others can run your exact copy
 
  -Original Message-
  From: Tyler Longren [mailto:[EMAIL PROTECTED]]
  Sent: Monday, November 12, 2001 11:22 PM
  To: Martin Towell; [EMAIL PROTECTED]
  Subject: Re: [PHP] for loop problem?
 
 
  I removed all of the quotes that could be affecting it.  Still, it loops
  until I stop it.  I let it go all the way up to 350,000 or so.  Any
other
  ideas anyone?
 
  Thank you!
  Tyler
 
  - Original Message -
  From: Martin Towell [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, November 12, 2001 10:06 PM
  Subject: RE: [PHP] for loop problem?
 
 
   hmmm... I just tried :
  
   $value1 = 100;
   $value2 = 1223109;
   for($i = $value1; $i = $value2; $i++)
   {
 echo $i\n;
   }
  
   and it spat out all 223109 numbers (albiet after a VERY long time)
   can't see how adding mysql code would affect the loop...
  
   Martin T
  
   -Original Message-
   From: Tyler Longren [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, November 13, 2001 2:53 PM
   To: Evan Nemerson; [EMAIL PROTECTED]
   Subject: Re: [PHP] for loop problem?
  
  
   To everyone that said it had something to do with the quotes:
   that has nothing to do with it.
  
   When I first wrote this, It didn't have all the quotes.  It did the
same
   thing.  Then, I thought I may need some quotes somewhere, but that
  obviously
   didn't help.  Any other suggestions?  If I HAVE to, I'll do this in
 PERL,
   but would much rather do it in PHP.
  
   Thanks everyone,
   Tyler
  
   - Original Message -
   From: Evan Nemerson [EMAIL PROTECTED]
   To: Tyler Longren [EMAIL PROTECTED];
[EMAIL PROTECTED]
   Sent: Monday, November 12, 2001 9:41 PM
   Subject: Re: [PHP] for loop problem?
  
  
My word why all the quotes?
   
?
$connection = mysql_connect(blah,blah,blah);
$db = mysql_select_db(db_to_use, $connection);
$value1 = 100;
$value2 = 1223109;
for($i=$value1; $i=$value2; $i++) {
 mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
 if (mysql_error() != ) {
  print font face=Arial size=2.mysql_error()./font;
  exit;
 }
}
mysql_close($connection);
?
   
That should give you some better results.
   
   
On Monday 12 November 2001 07:32 pm, you wrote:
 Hello everyone,

 I have a pretty big list of codes that need to be put into a mysql
 db.
   The
 numbers range from 100 to 1223109.  Here's the PHP I wrote to
 put
   these
 codes into a database:

 ?
 $connection = mysql_connect(blah,blah,blah);
 $db = mysql_select_db(db_to_use, $connection);
 $value1 = 100;
 $value2 = 1223109;
 for($i=$value1; $i=$value2; $i++) {
  mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
  if (mysql_error() != ) {
   print font face=Arial size=2.mysql_error()./font;
   exit;
  }
 }
 mysql_close($connection);
 ?

 Everytime I run this from a browser, it just keeps looping.  It
 should
   put
 about 223109 entries into the passcodes table.  However, it just
  keeps
 looping.  I'll end up with 400,000 or so entries before I stop it.
 I
   make
 sure I empty that table before I start running it again.  Why is
 this
 happening?

 Thanks everyone,
 Tyler
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail

RE: [PHP] for loop problem?

2001-11-12 Thread Martin Towell

How about changing the logic lightly? try this:

$value1 = 0;
$value2 = 223109;
for($i=$value1; $i=$value2; $i++) {
 $tmp = sprintf(1%06d\n, $i);
 mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$tmp'));

basically taking away 1,000,000 from the numbers then adding it back on
later

Martin T

-Original Message-
From: Tyler Longren [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 13, 2001 3:38 PM
To: Jack Dempsey
Cc: PHP-General
Subject: Re: [PHP] for loop problem?


I've ran it a few times without the MySQL code in there.  Runs just fine
that way for me too.  After it's run a few times for me (with the MySQL
code), I start getting duplicate entries of codes in there.  For example,
I'll end up with a few 'P100' entries in the 'passcodes' field.

Oh well, here I come perl!

Thanks,
Tyler

- Original Message -
From: Jack Dempsey [EMAIL PROTECTED]
To: Tyler Longren [EMAIL PROTECTED]; [EMAIL PROTECTED]
Sent: Monday, November 12, 2001 10:43 PM
Subject: RE: [PHP] for loop problem?


 ran it (without mysql queries) and worked finereal strange.
 have you tried the loop without the mysql queries?

 -Original Message-
 From: Tyler Longren [mailto:[EMAIL PROTECTED]]
 Sent: Monday, November 12, 2001 11:28 PM
 To: Jack Dempsey; [EMAIL PROTECTED]
 Subject: Re: [PHP] for loop problem?


 Exact code:
 ?
 $connection = mysql_connect(host_here,user_here,pass_here);
 $db = mysql_select_db(db_here, $connection);
 $value1 = 100;
 $value2 = 1223109;
 for($i=$value1; $i=$value2; $i++) {
  mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
  if (mysql_error() != ) {
   print font face=Arial size=2.mysql_error()./font;
   exit;
  }
 }
 mysql_close($connection);
 ?

 Tyler

 - Original Message -
 From: Jack Dempsey [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, November 12, 2001 10:34 PM
 Subject: RE: [PHP] for loop problem?


  paste the complete code in and myself and others can run your exact copy
 
  -Original Message-
  From: Tyler Longren [mailto:[EMAIL PROTECTED]]
  Sent: Monday, November 12, 2001 11:22 PM
  To: Martin Towell; [EMAIL PROTECTED]
  Subject: Re: [PHP] for loop problem?
 
 
  I removed all of the quotes that could be affecting it.  Still, it loops
  until I stop it.  I let it go all the way up to 350,000 or so.  Any
other
  ideas anyone?
 
  Thank you!
  Tyler
 
  - Original Message -
  From: Martin Towell [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, November 12, 2001 10:06 PM
  Subject: RE: [PHP] for loop problem?
 
 
   hmmm... I just tried :
  
   $value1 = 100;
   $value2 = 1223109;
   for($i = $value1; $i = $value2; $i++)
   {
 echo $i\n;
   }
  
   and it spat out all 223109 numbers (albiet after a VERY long time)
   can't see how adding mysql code would affect the loop...
  
   Martin T
  
   -Original Message-
   From: Tyler Longren [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, November 13, 2001 2:53 PM
   To: Evan Nemerson; [EMAIL PROTECTED]
   Subject: Re: [PHP] for loop problem?
  
  
   To everyone that said it had something to do with the quotes:
   that has nothing to do with it.
  
   When I first wrote this, It didn't have all the quotes.  It did the
same
   thing.  Then, I thought I may need some quotes somewhere, but that
  obviously
   didn't help.  Any other suggestions?  If I HAVE to, I'll do this in
 PERL,
   but would much rather do it in PHP.
  
   Thanks everyone,
   Tyler
  
   - Original Message -
   From: Evan Nemerson [EMAIL PROTECTED]
   To: Tyler Longren [EMAIL PROTECTED];
[EMAIL PROTECTED]
   Sent: Monday, November 12, 2001 9:41 PM
   Subject: Re: [PHP] for loop problem?
  
  
My word why all the quotes?
   
?
$connection = mysql_connect(blah,blah,blah);
$db = mysql_select_db(db_to_use, $connection);
$value1 = 100;
$value2 = 1223109;
for($i=$value1; $i=$value2; $i++) {
 mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
 if (mysql_error() != ) {
  print font face=Arial size=2.mysql_error()./font;
  exit;
 }
}
mysql_close($connection);
?
   
That should give you some better results.
   
   
On Monday 12 November 2001 07:32 pm, you wrote:
 Hello everyone,

 I have a pretty big list of codes that need to be put into a mysql
 db.
   The
 numbers range from 100 to 1223109.  Here's the PHP I wrote to
 put
   these
 codes into a database:

 ?
 $connection = mysql_connect(blah,blah,blah);
 $db = mysql_select_db(db_to_use, $connection);
 $value1 = 100;
 $value2 = 1223109;
 for($i=$value1; $i=$value2; $i++) {
  mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
  if (mysql_error() != ) {
   print font face=Arial size=2.mysql_error()./font;
   exit;
  }
 }
 mysql_close($connection);
 ?

 Everytime I run this from a browser, it just keeps looping.  It
 should
   put
 about

Re: [PHP] for loop problem?

2001-11-12 Thread Tyler Longren

Hi Martin,

I just got done doing that, and i got the same thing!  :-(

Here's something interesting though.  There's an id field that's set to
AUTO_INCREMENT.  I did a SELECT * FROM passcodes WHERE passcode='P100'
This gave me this:

id | passcode
---
1   |P100
82145   |P100
209398 |P100

Shouldn't the ID's be further apart than that?  Know what I'm saying?

Tyler

- Original Message -
From: Martin Towell [EMAIL PROTECTED]
To: 'Tyler Longren' [EMAIL PROTECTED]; Jack Dempsey
[EMAIL PROTECTED]
Cc: PHP-General [EMAIL PROTECTED]
Sent: Monday, November 12, 2001 10:45 PM
Subject: RE: [PHP] for loop problem?


 How about changing the logic lightly? try this:

 $value1 = 0;
 $value2 = 223109;
 for($i=$value1; $i=$value2; $i++) {
  $tmp = sprintf(1%06d\n, $i);
  mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$tmp'));

 basically taking away 1,000,000 from the numbers then adding it back on
 later

 Martin T

 -Original Message-
 From: Tyler Longren [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, November 13, 2001 3:38 PM
 To: Jack Dempsey
 Cc: PHP-General
 Subject: Re: [PHP] for loop problem?


 I've ran it a few times without the MySQL code in there.  Runs just fine
 that way for me too.  After it's run a few times for me (with the MySQL
 code), I start getting duplicate entries of codes in there.  For example,
 I'll end up with a few 'P100' entries in the 'passcodes' field.

 Oh well, here I come perl!

 Thanks,
 Tyler

 - Original Message -
 From: Jack Dempsey [EMAIL PROTECTED]
 To: Tyler Longren [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, November 12, 2001 10:43 PM
 Subject: RE: [PHP] for loop problem?


  ran it (without mysql queries) and worked finereal strange.
  have you tried the loop without the mysql queries?
 
  -Original Message-
  From: Tyler Longren [mailto:[EMAIL PROTECTED]]
  Sent: Monday, November 12, 2001 11:28 PM
  To: Jack Dempsey; [EMAIL PROTECTED]
  Subject: Re: [PHP] for loop problem?
 
 
  Exact code:
  ?
  $connection = mysql_connect(host_here,user_here,pass_here);
  $db = mysql_select_db(db_here, $connection);
  $value1 = 100;
  $value2 = 1223109;
  for($i=$value1; $i=$value2; $i++) {
   mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
   if (mysql_error() != ) {
print font face=Arial size=2.mysql_error()./font;
exit;
   }
  }
  mysql_close($connection);
  ?
 
  Tyler
 
  - Original Message -
  From: Jack Dempsey [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, November 12, 2001 10:34 PM
  Subject: RE: [PHP] for loop problem?
 
 
   paste the complete code in and myself and others can run your exact
copy
  
   -Original Message-
   From: Tyler Longren [mailto:[EMAIL PROTECTED]]
   Sent: Monday, November 12, 2001 11:22 PM
   To: Martin Towell; [EMAIL PROTECTED]
   Subject: Re: [PHP] for loop problem?
  
  
   I removed all of the quotes that could be affecting it.  Still, it
loops
   until I stop it.  I let it go all the way up to 350,000 or so.  Any
 other
   ideas anyone?
  
   Thank you!
   Tyler
  
   - Original Message -
   From: Martin Towell [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Monday, November 12, 2001 10:06 PM
   Subject: RE: [PHP] for loop problem?
  
  
hmmm... I just tried :
   
$value1 = 100;
$value2 = 1223109;
for($i = $value1; $i = $value2; $i++)
{
  echo $i\n;
}
   
and it spat out all 223109 numbers (albiet after a VERY long time)
can't see how adding mysql code would affect the loop...
   
Martin T
   
-Original Message-
From: Tyler Longren [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 13, 2001 2:53 PM
To: Evan Nemerson; [EMAIL PROTECTED]
Subject: Re: [PHP] for loop problem?
   
   
To everyone that said it had something to do with the quotes:
that has nothing to do with it.
   
When I first wrote this, It didn't have all the quotes.  It did the
 same
thing.  Then, I thought I may need some quotes somewhere, but that
   obviously
didn't help.  Any other suggestions?  If I HAVE to, I'll do this in
  PERL,
but would much rather do it in PHP.
   
Thanks everyone,
Tyler
   
- Original Message -
From: Evan Nemerson [EMAIL PROTECTED]
To: Tyler Longren [EMAIL PROTECTED];
 [EMAIL PROTECTED]
Sent: Monday, November 12, 2001 9:41 PM
Subject: Re: [PHP] for loop problem?
   
   
 My word why all the quotes?

 ?
 $connection = mysql_connect(blah,blah,blah);
 $db = mysql_select_db(db_to_use, $connection);
 $value1 = 100;
 $value2 = 1223109;
 for($i=$value1; $i=$value2; $i++) {
  mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
  if (mysql_error() != ) {
   print font face=Arial size=2.mysql_error()./font;
   exit;
  }
 }
 mysql_close($connection);
 ?

 That should give

Re: [PHP] for loop problem?

2001-11-12 Thread John Steele

Hi Tyler,

  This doesn't sound like a problem with PHP, but MySQL.  Can you show your CREATE 
TABLE and MySQL version?

John

Hi Martin,

I just got done doing that, and i got the same thing!  :-(

Here's something interesting though.  There's an id field that's set to
AUTO_INCREMENT.  I did a SELECT * FROM passcodes WHERE passcode='P100'
This gave me this:

id | passcode
---
1   |P100
82145   |P100
209398 |P100

Shouldn't the ID's be further apart than that?  Know what I'm saying?

Tyler

- Original Message -
From: Martin Towell [EMAIL PROTECTED]
To: 'Tyler Longren' [EMAIL PROTECTED]; Jack Dempsey
[EMAIL PROTECTED]
Cc: PHP-General [EMAIL PROTECTED]
Sent: Monday, November 12, 2001 10:45 PM
Subject: RE: [PHP] for loop problem?


 How about changing the logic lightly? try this:

 $value1 = 0;
 $value2 = 223109;
 for($i=$value1; $i=$value2; $i++) {
  $tmp = sprintf(1%06d\n, $i);
  mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$tmp'));

 basically taking away 1,000,000 from the numbers then adding it back on
 later

 Martin T

 -Original Message-
 From: Tyler Longren [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, November 13, 2001 3:38 PM
 To: Jack Dempsey
 Cc: PHP-General
 Subject: Re: [PHP] for loop problem?


 I've ran it a few times without the MySQL code in there.  Runs just fine
 that way for me too.  After it's run a few times for me (with the MySQL
 code), I start getting duplicate entries of codes in there.  For example,
 I'll end up with a few 'P100' entries in the 'passcodes' field.

 Oh well, here I come perl!

 Thanks,
 Tyler

 - Original Message -
 From: Jack Dempsey [EMAIL PROTECTED]
 To: Tyler Longren [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Sent: Monday, November 12, 2001 10:43 PM
 Subject: RE: [PHP] for loop problem?


  ran it (without mysql queries) and worked finereal strange.
  have you tried the loop without the mysql queries?
 
  -Original Message-
  From: Tyler Longren [mailto:[EMAIL PROTECTED]]
  Sent: Monday, November 12, 2001 11:28 PM
  To: Jack Dempsey; [EMAIL PROTECTED]
  Subject: Re: [PHP] for loop problem?
 
 
  Exact code:
  ?
  $connection = mysql_connect(host_here,user_here,pass_here);
  $db = mysql_select_db(db_here, $connection);
  $value1 = 100;
  $value2 = 1223109;
  for($i=$value1; $i=$value2; $i++) {
   mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
   if (mysql_error() != ) {
print font face=Arial size=2.mysql_error()./font;
exit;
   }
  }
  mysql_close($connection);
  ?
 
  Tyler
 
  - Original Message -
  From: Jack Dempsey [EMAIL PROTECTED]
  To: [EMAIL PROTECTED]
  Sent: Monday, November 12, 2001 10:34 PM
  Subject: RE: [PHP] for loop problem?
 
 
   paste the complete code in and myself and others can run your exact
copy
  
   -Original Message-
   From: Tyler Longren [mailto:[EMAIL PROTECTED]]
   Sent: Monday, November 12, 2001 11:22 PM
   To: Martin Towell; [EMAIL PROTECTED]
   Subject: Re: [PHP] for loop problem?
  
  
   I removed all of the quotes that could be affecting it.  Still, it
loops
   until I stop it.  I let it go all the way up to 350,000 or so.  Any
 other
   ideas anyone?
  
   Thank you!
   Tyler
  
   - Original Message -
   From: Martin Towell [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Monday, November 12, 2001 10:06 PM
   Subject: RE: [PHP] for loop problem?
  
  
hmmm... I just tried :
   
$value1 = 100;
$value2 = 1223109;
for($i = $value1; $i = $value2; $i++)
{
  echo $i\n;
}
   
and it spat out all 223109 numbers (albiet after a VERY long time)
can't see how adding mysql code would affect the loop...
   
Martin T
   
-Original Message-
From: Tyler Longren [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 13, 2001 2:53 PM
To: Evan Nemerson; [EMAIL PROTECTED]
Subject: Re: [PHP] for loop problem?
   
   
To everyone that said it had something to do with the quotes:
that has nothing to do with it.
   
When I first wrote this, It didn't have all the quotes.  It did the
 same
thing.  Then, I thought I may need some quotes somewhere, but that
   obviously
didn't help.  Any other suggestions?  If I HAVE to, I'll do this in
  PERL,
but would much rather do it in PHP.
   
Thanks everyone,
Tyler
   
- Original Message -
From: Evan Nemerson [EMAIL PROTECTED]
To: Tyler Longren [EMAIL PROTECTED];
 [EMAIL PROTECTED]
Sent: Monday, November 12, 2001 9:41 PM
Subject: Re: [PHP] for loop problem?
   
   
 My word why all the quotes?

 ?
 $connection = mysql_connect(blah,blah,blah);
 $db = mysql_select_db(db_to_use, $connection);
 $value1 = 100;
 $value2 = 1223109;
 for($i=$value1; $i=$value2; $i++) {
  mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
  if (mysql_error() != ) {
   print font face

Re: [PHP] for loop problem?

2001-11-12 Thread Tyler Longren

Hi John,

MySQL Version: MySQL 3.23.44-nt

SQL:
CREATE TABLE passcodes (
  id int(11) NOT NULL auto_increment,
  passcode varchar(255) NOT NULL default '',
  PRIMARY KEY  (id),
  KEY id (id,passcode)
) TYPE=MyISAM;

I'm beginning to think it's a MySQL problem also because this PHP SHOULD
work.

Tyler

- Original Message -
From: John Steele [EMAIL PROTECTED]
To: PHP General List [EMAIL PROTECTED]
Sent: Monday, November 12, 2001 3:33 PM
Subject: Re: [PHP] for loop problem?


 Hi Tyler,

   This doesn't sound like a problem with PHP, but MySQL.  Can you show
your CREATE TABLE and MySQL version?

 John

 Hi Martin,
 
 I just got done doing that, and i got the same thing!  :-(
 
 Here's something interesting though.  There's an id field that's set to
 AUTO_INCREMENT.  I did a SELECT * FROM passcodes WHERE
passcode='P100'
 This gave me this:
 
 id | passcode
 ---
 1   |P100
 82145   |P100
 209398 |P100
 
 Shouldn't the ID's be further apart than that?  Know what I'm saying?
 
 Tyler
 
 - Original Message -
 From: Martin Towell [EMAIL PROTECTED]
 To: 'Tyler Longren' [EMAIL PROTECTED]; Jack Dempsey
 [EMAIL PROTECTED]
 Cc: PHP-General [EMAIL PROTECTED]
 Sent: Monday, November 12, 2001 10:45 PM
 Subject: RE: [PHP] for loop problem?
 
 
  How about changing the logic lightly? try this:
 
  $value1 = 0;
  $value2 = 223109;
  for($i=$value1; $i=$value2; $i++) {
   $tmp = sprintf(1%06d\n, $i);
   mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$tmp'));
 
  basically taking away 1,000,000 from the numbers then adding it back on
  later
 
  Martin T
 
  -Original Message-
  From: Tyler Longren [mailto:[EMAIL PROTECTED]]
  Sent: Tuesday, November 13, 2001 3:38 PM
  To: Jack Dempsey
  Cc: PHP-General
  Subject: Re: [PHP] for loop problem?
 
 
  I've ran it a few times without the MySQL code in there.  Runs just
fine
  that way for me too.  After it's run a few times for me (with the MySQL
  code), I start getting duplicate entries of codes in there.  For
example,
  I'll end up with a few 'P100' entries in the 'passcodes' field.
 
  Oh well, here I come perl!
 
  Thanks,
  Tyler
 
  - Original Message -
  From: Jack Dempsey [EMAIL PROTECTED]
  To: Tyler Longren [EMAIL PROTECTED];
[EMAIL PROTECTED]
  Sent: Monday, November 12, 2001 10:43 PM
  Subject: RE: [PHP] for loop problem?
 
 
   ran it (without mysql queries) and worked finereal strange.
   have you tried the loop without the mysql queries?
  
   -Original Message-
   From: Tyler Longren [mailto:[EMAIL PROTECTED]]
   Sent: Monday, November 12, 2001 11:28 PM
   To: Jack Dempsey; [EMAIL PROTECTED]
   Subject: Re: [PHP] for loop problem?
  
  
   Exact code:
   ?
   $connection = mysql_connect(host_here,user_here,pass_here);
   $db = mysql_select_db(db_here, $connection);
   $value1 = 100;
   $value2 = 1223109;
   for($i=$value1; $i=$value2; $i++) {
mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
if (mysql_error() != ) {
 print font face=Arial size=2.mysql_error()./font;
 exit;
}
   }
   mysql_close($connection);
   ?
  
   Tyler
  
   - Original Message -
   From: Jack Dempsey [EMAIL PROTECTED]
   To: [EMAIL PROTECTED]
   Sent: Monday, November 12, 2001 10:34 PM
   Subject: RE: [PHP] for loop problem?
  
  
paste the complete code in and myself and others can run your exact
 copy
   
-Original Message-
From: Tyler Longren [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 12, 2001 11:22 PM
To: Martin Towell; [EMAIL PROTECTED]
Subject: Re: [PHP] for loop problem?
   
   
I removed all of the quotes that could be affecting it.  Still, it
 loops
until I stop it.  I let it go all the way up to 350,000 or so.  Any
  other
ideas anyone?
   
Thank you!
Tyler
   
- Original Message -
From: Martin Towell [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 12, 2001 10:06 PM
Subject: RE: [PHP] for loop problem?
   
   
 hmmm... I just tried :

 $value1 = 100;
 $value2 = 1223109;
 for($i = $value1; $i = $value2; $i++)
 {
   echo $i\n;
 }

 and it spat out all 223109 numbers (albiet after a VERY long
time)
 can't see how adding mysql code would affect the loop...

 Martin T

 -Original Message-
 From: Tyler Longren [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, November 13, 2001 2:53 PM
 To: Evan Nemerson; [EMAIL PROTECTED]
 Subject: Re: [PHP] for loop problem?


 To everyone that said it had something to do with the quotes:
 that has nothing to do with it.

 When I first wrote this, It didn't have all the quotes.  It did
the
  same
 thing.  Then, I thought I may need some quotes somewhere, but
that
obviously
 didn't help.  Any other suggestions?  If I HAVE to, I'll do this
in
   PERL,
 but would much

Re: [PHP] for loop problem?

2001-11-12 Thread Christopher William Wesley

I just ran your code as you pasted earlier, and set up a mysql database
with the table defined below ... and it inserted 223,110 passcodes into
the table.

PHP 4.0.99-3  (Identifies itself as 4.1.0RC1)
MySQL 3.23.43-3

~Chris   /\
 \ / September 11, 2001
  X  We Are All New Yorkers
 / \ rm -rf /bin/laden

On Mon, 12 Nov 2001, Tyler Longren wrote:

 Hi John,

 MySQL Version: MySQL 3.23.44-nt

 SQL:
 CREATE TABLE passcodes (
   id int(11) NOT NULL auto_increment,
   passcode varchar(255) NOT NULL default '',
   PRIMARY KEY  (id),
   KEY id (id,passcode)
 ) TYPE=MyISAM;

 I'm beginning to think it's a MySQL problem also because this PHP SHOULD
 work.

 Tyler

 - Original Message -
 From: John Steele [EMAIL PROTECTED]
 To: PHP General List [EMAIL PROTECTED]
 Sent: Monday, November 12, 2001 3:33 PM
 Subject: Re: [PHP] for loop problem?


  Hi Tyler,
 
This doesn't sound like a problem with PHP, but MySQL.  Can you show
 your CREATE TABLE and MySQL version?
 
  John
 
  Hi Martin,
  
  I just got done doing that, and i got the same thing!  :-(
  
  Here's something interesting though.  There's an id field that's set to
  AUTO_INCREMENT.  I did a SELECT * FROM passcodes WHERE
 passcode='P100'
  This gave me this:
  
  id | passcode
  ---
  1   |P100
  82145   |P100
  209398 |P100
  
  Shouldn't the ID's be further apart than that?  Know what I'm saying?
  
  Tyler
  
  - Original Message -
  From: Martin Towell [EMAIL PROTECTED]
  To: 'Tyler Longren' [EMAIL PROTECTED]; Jack Dempsey
  [EMAIL PROTECTED]
  Cc: PHP-General [EMAIL PROTECTED]
  Sent: Monday, November 12, 2001 10:45 PM
  Subject: RE: [PHP] for loop problem?
  
  
   How about changing the logic lightly? try this:
  
   $value1 = 0;
   $value2 = 223109;
   for($i=$value1; $i=$value2; $i++) {
$tmp = sprintf(1%06d\n, $i);
mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$tmp'));
  
   basically taking away 1,000,000 from the numbers then adding it back on
   later
  
   Martin T
  
   -Original Message-
   From: Tyler Longren [mailto:[EMAIL PROTECTED]]
   Sent: Tuesday, November 13, 2001 3:38 PM
   To: Jack Dempsey
   Cc: PHP-General
   Subject: Re: [PHP] for loop problem?
  
  
   I've ran it a few times without the MySQL code in there.  Runs just
 fine
   that way for me too.  After it's run a few times for me (with the MySQL
   code), I start getting duplicate entries of codes in there.  For
 example,
   I'll end up with a few 'P100' entries in the 'passcodes' field.
  
   Oh well, here I come perl!
  
   Thanks,
   Tyler
  
   - Original Message -
   From: Jack Dempsey [EMAIL PROTECTED]
   To: Tyler Longren [EMAIL PROTECTED];
 [EMAIL PROTECTED]
   Sent: Monday, November 12, 2001 10:43 PM
   Subject: RE: [PHP] for loop problem?
  
  
ran it (without mysql queries) and worked finereal strange.
have you tried the loop without the mysql queries?
   
-Original Message-
From: Tyler Longren [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 12, 2001 11:28 PM
To: Jack Dempsey; [EMAIL PROTECTED]
Subject: Re: [PHP] for loop problem?
   
   
Exact code:
?
$connection = mysql_connect(host_here,user_here,pass_here);
$db = mysql_select_db(db_here, $connection);
$value1 = 100;
$value2 = 1223109;
for($i=$value1; $i=$value2; $i++) {
 mysql_query(INSERT INTO passcodes (passcode) VALUES ('P$i'));
 if (mysql_error() != ) {
  print font face=Arial size=2.mysql_error()./font;
  exit;
 }
}
mysql_close($connection);
?
   
Tyler
   
- Original Message -
From: Jack Dempsey [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 12, 2001 10:34 PM
Subject: RE: [PHP] for loop problem?
   
   
 paste the complete code in and myself and others can run your exact
  copy

 -Original Message-
 From: Tyler Longren [mailto:[EMAIL PROTECTED]]
 Sent: Monday, November 12, 2001 11:22 PM
 To: Martin Towell; [EMAIL PROTECTED]
 Subject: Re: [PHP] for loop problem?


 I removed all of the quotes that could be affecting it.  Still, it
  loops
 until I stop it.  I let it go all the way up to 350,000 or so.  Any
   other
 ideas anyone?

 Thank you!
 Tyler

 - Original Message -
 From: Martin Towell [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Monday, November 12, 2001 10:06 PM
 Subject: RE: [PHP] for loop problem?


  hmmm... I just tried :
 
  $value1 = 100;
  $value2 = 1223109;
  for($i = $value1; $i = $value2; $i++)
  {
echo $i\n;
  }
 
  and it spat out all 223109 numbers (albiet after a VERY long
 time