William The Dev William The Dev - 5 months ago 8x
SQL Question

Extracting values from SELECT WHERE IN query MySQL

This is a follow up on minimize select queries on the same table Mysql. I did not get a full answer on how to extract the individual array values returned by the following query:

$result = mysqli_query("SELECT * FROM u_settings WHERE setting IN
('username', 'password','email','tag','active','version','time','warn','dis')");

How do I extract any value I want from the
array since many rows having the same columns will be returned?

$result = mysql_query("SELECT * FROM u_settings WHERE setting IN
 ('username', 'password','email','tag','active','version','time','warn','dis')");

while($row = mysql_fetch_assoc($result))
    $settings[$row['setting']] = $row['u_settings'];