dtol41388 2016-07-21 05:46
浏览 156
已采纳

PHP从数据库中获取数据

enter image description here

I'm trying to fetch data from hashtag where is #a2 or #ar hashtag but not work with my code

$sql_query = mysqli_query($conn, "SELECT * FROM posts WHERE hashtag=#a2");
  • 写回答

3条回答 默认 最新

  • dtslobe4694 2016-07-21 05:49
    关注

    try this,

    $data = "#a2";
    $sql_query = mysqli_query($conn, "SELECT * FROM posts WHERE hashtag LIKE '%$data%'");
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?