kevinkhan Posted March 29, 2010 Share Posted March 29, 2010 Hi guys.. I have two database, one has 17000 numbers and the other one has only 3 numbers.. When i run the script below using the database with 17000 numbers i get this error "Lost connection to MySQL server during query" and when i run the script with the the database that has only 3 numbers in it.. the script works perfect... $config['dbhost'] = 'hostname'; $config['dbuser'] = 'kevin'; $config['dbpass'] = 'password'; $config['dbname'] = 'database with 1700 numbers'; //$config['dbhost'] = 'mysql359int.cp.blacknight.com'; //$config['dbuser'] = 'u1001236_test'; //$config['dbpass'] = 'password'; //$config['dbname'] = 'db1001236_testing'; set_time_limit(0); ini_set('error_reporting', E_ALL); error_reporting(E_ERROR | E_WARNING | E_PARSE); //define the base path for the files $maindir = dirname(__FILE__) . DIRECTORY_SEPARATOR; //connect to the databse server and select database. @mysql_connect($config['dbhost'], $config['dbuser'], $config['dbpass']) or die(mysql_error()); @mysql_select_db($config['dbname']) or die(mysql_error()); $sql = "SELECT * FROM `phone_number` WHERE `phone` NOT IN (SELECT `phone` FROM `phone_number_sent`)"; $rea = @mysql_query($sql) or die(mysql_error()); //define phone list array $phone_list = array(); // rsa = record set array while ($rsa=mysql_fetch_array($rea)) { echo $rsa['phone']."<br />"; //$phone_list[] = array($rsa['phone'], $rsa['source']); } Does any body know what the problem might be? Quote Link to comment Share on other sites More sharing options...
Deoctor Posted March 29, 2010 Share Posted March 29, 2010 it is related to the mysql query timeout check for this one mysql.connect_timeout also check for this one max_execution_time Quote Link to comment Share on other sites More sharing options...
kevinkhan Posted March 29, 2010 Author Share Posted March 29, 2010 it is related to the mysql query timeout check for this one mysql.connect_timeout also check for this one max_execution_time How and where can i check for this please? Quote Link to comment Share on other sites More sharing options...
Deoctor Posted March 29, 2010 Share Posted March 29, 2010 check ur phpinfo for these values Quote Link to comment Share on other sites More sharing options...
kevinkhan Posted March 29, 2010 Author Share Posted March 29, 2010 is there a better way of writing this query if there are 1000s of records SELECT * FROM `phone_number` WHERE `phone` NOT IN (SELECT `phone` FROM `phone_number_sent`) it seems to crash only where there is a 1000s of records Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.