doujia1988 2013-11-03 18:39
浏览 56

mysqli_query不提供电子邮件查询的结果

I have a database in phpmyadmin and im trying to query the email fields from it, and it doesn't seem to work. The email field type is varchar and they contain the @ special character: example@domain.com I tried querying from the phpmyadmin console too but with no success.

Im using the following mysqli_query to get the specific fields:

ex: $email="example@domain.com"

$qres = mysqli_query($conn, "SELECT * FROM users WHERE email='".$email."'")
or die("Query error!");
$match = mysqli_num_rows($qres);
echo $match;

The $match variable returns 0 which means the query works but doesn't return any result, but my database contains multiple entries with the specific email. Im guessing that is something to do with the @ special character, but not really sure.

  • 写回答

1条回答 默认 最新

  • dongshuohuan5291 2013-11-03 19:06
    关注

    use like keyword in sql statement like this

    $qres = mysqli_query($conn, "SELECT * FROM users WHERE email like '%$email%'");
    
    评论

报告相同问题?

悬赏问题

  • ¥15 BV260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序