losing connection to mysql during query

From: Date: Thu, 05 Oct 2000 17:10:13 +0000
Subject: losing connection to mysql during query
Groups: php.general 
Request: Send a blank email to php-general+get-18750@lists.php.net to get a copy of this message
I have a script which I'm using to move records from one table to another while checking for duplicates. It worked great for several days, but now I get "Lost connection to MySQL server during query" right at the first insert and it bombs out. Here is my script: <? set_time_limit(0); $my = mysql_connect("localhost",$user,$pass); mysql_select_db("dbereferen",$my); $q1 = "select link_id,link_reference,link_url from backup limit 500"; $r1 = mysql_query($q1,$my); $error = mysql_error($my); echo $error."<br>"; while($row = mysql_fetch_array($r1)) { $link_id = $row[0]; $link_reference = $row[1]; $link_url = $row[2]; $q2 = "insert ignore into links values ('','$link_reference','$link_url',0,'',21,now())"; $r2 = mysql_query($q2,$my); } mysql_close($my); ?> The table it is adding the records to currently has about 1.3 million records, and the table it is taking them from started out with about 1.8 million records. So if anyone has any suggestions on why all of a sudden it won't stay connected I'd greatly appreciate it. Robert

« previous php.general (#18750) next »