Note that there are some explanatory texts on larger screens.

plurals
  1. POMYSQL close connect can not halt the insert activity
    primarykey
    data
    text
    <pre><code>&lt;?php header('Content-Type: text/html; charset=utf8'); $dbhost = '192.168.1.23'; $dbuser = 'demouser01'; $dbpass = 'demo*PW'; $dbname = 'testdb1'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die('Error with MySQL connection'); mysql_select_db($dbname); mysql_query("SET NAMES 'utf8'"); mysql_query("SET CHARACTER_SET_CLIENT='utf8'"); mysql_query("SET CHARACTER_SET_RESULTS='utf8'"); if(isset($_POST['start'])) { $chi = 'chiiiii'; $id = 1; for ($i = 1; $i &lt;= 99999999999; $i++) { $eng = substr(str_shuffle(str_repeat("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", 5)), 0, 1024); $math = substr(str_shuffle(str_repeat("1234567890", 6)), 0, 16); $sql = "INSERT INTO test_tb (id,chi,eng,num) VALUES (".$id.",'".$chi."','".$eng."',".$math.")"; $result = mysql_query($sql) or die('MySQL query error'); $id++; } $id = 0; sleep(60); mysql_close($conn); } else if(isset($_POST['stop'])) { mysql_close($conn); } ?&gt; &lt;form action="&lt;?=$_SERVER['PHP_SELF'];?&gt;" method="post"&gt; &lt;input type="submit" name="start" value="Start Insert"&gt; &lt;input type="submit" name="stop" value="Stop Insert"&gt; &lt;/form&gt; </code></pre> <p>There are two buttons in the website, insert to insert a record repeatedly, and stop to halt the insert. However, I tried using the MySQL close connection, it will stop functioning in PHP, but the activity still remains there. The insert still keeps performing. How to fix the problem? Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload