如何检查数组查询中是否存在结果

i have a problem that is driving me nuts. Maybe you can help me out. I have something like this:

$result_listas = mysqli_query($link, "some mysql query");
while($row = mysqli_fetch_array($result_listas, MYSQLI_BOTH))
{
  for($i=$resultado_min['id']; $i<=$resultado_max['id']; $i++)
  { 
    if ($row[id]=$i) 
    {
    echo "The '$i' element exist in the array";
    }
    else
    {
    echo"$i does not exist in the query";
    }
  }
}

Basically what i want to do is check if '$i' exist as an ID within the '$result_listas' query. I'm sure is quite simple but i've being programming all day and my brain is melted! thanks guys!

查看全部
dousao2186
dousao2186
2013/12/09 16:42
  • php
  • mysql
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

2个回复