rofl90 Posted June 11, 2008 Share Posted June 11, 2008 For some reason this code just goes blank, constantly loading, it should atleast echo the success/failure <?php $CONF = array(); $CONF["DATABASE"] = 'x'; $CONF["USERNAME"] = 'x'; $CONF["PASSWORD"] = 'x'; $CONF["HOST"] = 'x'; mysql_connect($CONF["HOST"], $CONF["USERNAME"], $CONF["PASSWORD"]); mysql_select_db($CONF["DATABASE"]); $first = '100000'; while($first < '9999999') { $fileName = "http://www.x.com/x-g--d" . $first . ".html"; $file = file_get_contents($fileName); if(mysql_query("INSERT INTO pages (linkName, theText) VALUES('$fileName', '$file')")) { echo "Success\n\n"; $first = $first + '1'; } else { echo "Failure\n\n"; } } ?> Link to comment https://forums.phpfreaks.com/topic/109786-strange-nothing-happening/ Share on other sites More sharing options...
craygo Posted June 11, 2008 Share Posted June 11, 2008 use $first++ not $first + '1'. When you put the 1 in quotes it becomes a string not an integer. Ray Link to comment https://forums.phpfreaks.com/topic/109786-strange-nothing-happening/#findComment-563377 Share on other sites More sharing options...
rofl90 Posted June 11, 2008 Author Share Posted June 11, 2008 Still doesn't load load, but thanks. Link to comment https://forums.phpfreaks.com/topic/109786-strange-nothing-happening/#findComment-563378 Share on other sites More sharing options...
craygo Posted June 11, 2008 Share Posted June 11, 2008 it probably won't load cause your trying to do 9.8 million loops. PHP processes the script then outputs it to the browser. It will take some time to process 9.8 million loops. Before you try something this large why not run a test on a couple or so to make sure it works. Ray Link to comment https://forums.phpfreaks.com/topic/109786-strange-nothing-happening/#findComment-563394 Share on other sites More sharing options...
rofl90 Posted June 11, 2008 Author Share Posted June 11, 2008 Ah, ok. I ll try it Link to comment https://forums.phpfreaks.com/topic/109786-strange-nothing-happening/#findComment-563399 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.