dtntjwkl83750 2014-10-19 08:00
浏览 78

PHP mysql-> prepare()查询中的IN子句不起作用 - 发布更新

I am having trouble creating prepared statement, it always returns false and i don't understand why. I have looked into other similar questions asked here at stack overflow but they were of little help and I am still stuck with this.

I checked DB connection and its working fine. I also ran the query with TOAD and it's working.

$msqli = new mysqli($dbHost, $dbUser, $dbPass, $dbName, $dbPort);

$prepstmt = $msqli->prepare("select lr.bank_id,lr.bank_name,lr.loan_rate from msdb1.loan_rates lr where lr.bank_id in ? and lr.from_amount = ? and lr.to_amount <= ? and lr.floating = ? and lr.salaried in ? and lr.professional in ? and lr.gender = ?");

The above statement always returns false.

I have already spent good amount of time on it. I am new to PHP programming. Please help me out.

EDIT: I forgot to add other things. In IN clause I am making a list like ('val1','val2').

$prepstmt->bind_param("siissss", $bnkIdFmtList,$frmAmt,$toAmt,$intType,$bind_sal,$bind_pro,$gender);
$prepstmt->execute();
$prepstmt->bind_result($bank_id,$bank_name,$loan_rate);
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
    • ¥15 个人网站被恶意大量访问,怎么办
    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 Centos / PETGEM
    • ¥15 划分vlan后不通了
    • ¥15 GDI处理通道视频时总是带有白色锯齿
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)
    • ¥15 自适应 AR 模型 参数估计Matlab程序
    • ¥100 角动量包络面如何用MATLAB绘制