我正在阅读csv并使用mysql检查记录是否存在于我的表中或不存在于php中.
csv有大约25000条记录,当我运行我的代码时,它显示"服务不可用"错误2m 10s后(onload:2m 10s)
这里我添加了代码
// for set memory limit & execution time
ini_set('memory_limit', '512M');
ini_set('max_execution_time', '180');
//function to read csv file
function readCSV($csvFile)
{
$file_handle = fopen($csvFile, 'r');
while (!feof($file_handle) ) {
set_time_limit(60); // you can enable this if you have lot of data
$line_of_text[] = fgetcsv($file_handle, 1024);
}
fclose($file_handle);
return $line_of_text;
}
// Set path to CSV file
$csvFile = 'my_records.csv';
$csv = readCSV($csvFile);
for($i=1;$i<count($csv);$i++)
{
$user_email= $csv[$i][1];
$qry = "SELECT u.user_id, u.user_email_id FROM tbl_user as u WHERE …Run Code Online (Sandbox Code Playgroud) 我有一些像这样的记录
id name sequence
------------------------
1 steve 3
2 lee 2
3 lisa 1
4 john 0
5 smith 0
Run Code Online (Sandbox Code Playgroud)
我想显示如下记录
id name
------------
1 lisa
2 lee
3 steve
4 john
5 smith
Run Code Online (Sandbox Code Playgroud)
当我使用order by子句时,它显示为
name
----
john
smith
lisa
lee
steve
Run Code Online (Sandbox Code Playgroud)
SELECT name from tbl1 where 1 ORDER BY sequence ASC
Run Code Online (Sandbox Code Playgroud) 我有JavaScript函数,传递一个参数
<script type="text/javascript">
function myfun(var1)
{
var returnVal = "<?php echo get_value(); ?>";
}
</script>
Run Code Online (Sandbox Code Playgroud)
我想通过JavaScript变量即var1到get_value();