PHP get one row from an array based on a variables value -
if create array results returned in mysqli query there way select , use 1 specific row array?
$info= array(); while($row = mysqli_fetch_assoc($query)) { $info[] = array( 'id' => $row['id'], 'location' => $row['location'] ); }
how go displaying single row array id equals variable $id?
in loop like:
if ($id == $row['id']) { $info[] = $row; }
however make more sense me update query.
select cols t1 id = :id
using $id
parameter.
Comments
Post a Comment