Hello,
function chk_commit_query(table_name,reg_id_base, reg_id_cmp, csv_file){
if(chk_items.length === 0){
alert('no items selected! And select all items in default!');
chk_sql_base = 'select * from ' + table_name + ' where Regression_Id = ' + reg_id_base;
chk_sql_cmp = 'select * from ' + table_name + ' where Regression_Id = ' + reg_id_cmp;
}
else{
chk_sql_base = 'select TestCase, Design_name, ';
chk_sql_cmp = 'select TestCase, Design_name, ';
for (var i=0;i<chk_items.length - 1;i++){
chk_sql_base += chk_items[i] + ', '
chk_sql_cmp += chk_items[i] + ', '
}
chk_sql_base += chk_items[i] + ' from ' + table_name + ' where Regression_Id = ' + reg_id_base;
chk_sql_cmp += chk_items[i] + ' from ' + table_name + ' where Regression_Id = ' + reg_id_cmp;
}
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
{
return
}
var url="show_cmp_internal_chk_table.php"
url=url+"?sql_chk_cmp1 ="+chk_sql_cmp;
url=url+"&sql_chk_base="+chk_sql_base;
url=url+"&csv_file="+csv_file;
url=url+"&sid="+Math.random()
alert(url);
//此处得到的数据为:
xmlHttp.onreadystatechange=chk_stateChanged
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
show_cmp_internal_chk_table.php:
<?php
$csv_data4 = Array();
$sql_chk_cmp = $_GET["sql_chk_cmp1"];
$sql_chk_base = $_GET["sql_chk_base"];
echo $sql_chk_base."<br>";
echo $sql_chk_cmp."<br>";
...
这里$sql_chk_base有数据,$sql_chk_cmp无论如何却为空,看url的信息也是有这个数据的,这是什么事情啊。这样的ajax代码用的少说也得数百次了。
------解决方案--------------------
莫非url参数后面多了个空格?
------解决方案--------------------