嗨我有数据要上传到Mysql数据库,我需要为每行插入所需的时间,以便我可以将该数字传递到进度条。我已经尝试通过确定插入所获得的行数来完成此操作,然后找到该数字的百分比,这是不正确的方式来做到这一点。为插入到MySQL数据库的每行所花费的时间
这里是代码
$result3=mysql_query("INSERT INTO dest_table.create_info SELECT * from Profusion.source_cdr") or die(mysql_error());
$progress=mysql_affected_rows();
// Total processes
$total = $progress;
// Loop through process
for($i=1; $i<=$total; $i++){
// Calculate the percentage
$percent = intval($i/$total * 100)."%";
echo $percent;
这实际上划分的行1和的总数100乘以得到的百分比,这是错误的。
我需要每插入一行所需的时间,然后找到其中的百分比。
我们将非常感谢您的帮助。
嗨Yousuf现在如何使脚本和queery同时执行? – user1002713