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

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -