我试图使用"where in"子句获取顶级信息但如果我使用bindvalue或bindparam我没有得到任何结果.
这是我的查询没有给出任何结果
$user2 = $db->prepare("Select top 100 memb_guid,memb___id,mail_addr,Gender,Country from MEMB_INFO where memb___id in (Select memb___id from MEMB_STAT where IP = :ip)");
$user2->bindValue(':ip','127.0.0.1',PDO::PARAM_STR);
$user2->execute();
Run Code Online (Sandbox Code Playgroud)
如果我使用没有任何绑定值或参数的直接搜索,我会得到结果
$user2 = $db->prepare("Select top 100 memb_guid,memb___id,mail_addr,Gender,Country from MEMB_INFO where memb___id in (Select memb___id from MEMB_STAT where IP = '127.0.0.1')");
$user2->execute();
Run Code Online (Sandbox Code Playgroud)
任何人都可以帮助我在这个搜索'where in'子句中使用bindvalue或param吗?
@PhilCross这是我在使用var_dump时得到的:
object(PDOStatement)#4 (1) { ["queryString"]=> string(142) "Select top 100 memb_guid,memb___id,mail_addr,Gender,Country from MEMB_INFO where memb___id in (Select memb___id from MEMB_STAT where IP = :ip)"
Run Code Online (Sandbox Code Playgroud)
Ps:我正在使用MSSQL Server
所以我将这2个jQuery函数存储在.js文件中,并且.js文件在head标记之前加载
.js文件中的内容:
$(document).ready(function(){
$("#button1").click(function(){
$.ajax({
type: 'GET',
url: 'button2.php',
success:
function(html){
$('#button_div').html(html)
}
,
});
});
$("#button2").click(function(){
$.ajax({
type: 'GET',
url: 'button1.php',
success:
function(html){
$('#button_div').html(html)
}
,
});
});
});
Run Code Online (Sandbox Code Playgroud)
所以身体后我有:
<div id="button_div"><input type="button" id="button1" value="Press"></div>
Run Code Online (Sandbox Code Playgroud)
当按下button1时,将使用div和button2代码加载名为button2.php的php文件,但是当按下button2时将不会执行button2单击功能.
为什么?
如果我将button2的jQuery代码放在button2.php文件中,之后元素将正常工作.但我不希望这样.我想保持jQuery行只保存在.js文件中,并且仅在</head>tag 之前保存.我不想在元素之后使用jQuery行.
我使用 $.parseJSON 从链接中获取数据。
我的输出链接有
{"status":"ok", "message":'<form><input type="text" name="" value=""> </form>'}
Run Code Online (Sandbox Code Playgroud)
我想将“消息”附加到我的内容中。
$.ajax({
type : "POST",
url : "mylinl.php",
data : reservationForm.serialize(),
success : function(result) {
var data = $.parseJSON(result);
var result = data.status;
var message = data.message;
if (result == 'ok') {
$('#mycontent').html(message);
} else {
alert('Error Message: ' + message);
}
},
Run Code Online (Sandbox Code Playgroud)
所以我想得到消息:<form><input type="text" name="" value=""> </form>从我的链接和输出到我的#mycontent。那可能吗?
对不起,我的英语不好
我在托管上有一些PHP脚本,但托管时间与我当地时间不同(GMT + 8)如何设置正确的时间()脚本为GMT + 8?
当我使用:
<?
echo time(); //it show me the hosting time;
?>
Run Code Online (Sandbox Code Playgroud) 我有一个JavaScript函数可以舍入数字.
function roundNumber(num){
var result = Math.round(num*100)/100;
return result;
}
alert(roundNumber(5334.5));
//I still get 5334.5 when normally I should get 5335
Run Code Online (Sandbox Code Playgroud)
我错过了什么?