mysql - PHP Mysqli trigger a query one after other -
i trying fetch first id 1 table , later after ids fetched trying fetch number of id's.
my problem
- as want select value of first query completion result
i unable trigger second query after first query completed both triggerid @ time
first query
$query ="select * abc xyz='xyz' , standard='xyz' "; $data=mysqli_query($mysqli,$query)or die(mysqli_error()); $id = array(); while($row=mysqli_fetch_array($data)){ $id[] = $row['id']; } $idall = "'" . implode("','", $id) . "'";
second query
$query="select mobno euser userid in ($idall)" ; $data=mysqli_query($mysqli,$query)or die(mysqli_error()); $mobiles = array(); while($row=mysqli_fetch_array($data)){ $mobiles[] = $row['mobilenum']; } $mobilesstr = implode(',', $mobiles); echo $mobilesstr; }
try
select mobno euser userid in (select id abc xyz='xyz' , standard='xyz');
Comments
Post a Comment