I have this while loop, that basically loops through a lot of records in a database, and inserts the data in another:
$q = $con1->query($users1) or die(pr
You can't. The php is first interpreted by the server and then send to the user as HTML-Code. The only possibility would be creating a html-page and call the php-script with AJAX.