$qurym="SELECT * FROM referal_member WHERE `ref_cusid` = '$id' && `confirm` = '1'";
$resm=mysqli_query($con,$qurym);
$rowm=mysqli_fetch_array($resm);
答案 0 :(得分:0)
试试这样:[如果字段(ref_cusid
和confirm
)属于INT
类型,则传递值$id
和1
,不带单引号('
),否则进行如下更改]
$qurym = "SELECT * FROM referal_member
WHERE `ref_cusid` = ' " . $id . "'
AND `confirm` = '1'";
$resm = mysqli_query($con,$qurym);
// check query returns something or not
if(mysqli_num_rows($resm)){
// fetch data
$rowm=mysqli_fetch_array($resm);
}
else{
// no data found
}
答案 1 :(得分:0)
如果是整数数据类型,请从确认中删除引号。
$qurym="SELECT * FROM referal_member WHERE `ref_cusid` = '$id' && `confirm` = 1";
$resm=mysqli_query($con,$qurym);
$rowm=mysqli_fetch_array($resm);
print_r($rowm); // to check results.
或者如果ref_cusid也是整数类型。
$qurym="SELECT * FROM referal_member WHERE `ref_cusid` = $id && `confirm` = 1";
$resm=mysqli_query($con,$qurym);
$rowm=mysqli_fetch_array($resm);
print_r($rowm); // to check results.