I would like to reduce the number of MySQL queries executed by running a single SELECT statement then later referencing the results, preferably by a single column. Unfortunately, I'm not quite sure how and am hoping for a bit of help. The SELECT statement looks like this:
$sqlQuery = "SELECT username,email,phone FROM users";
$sqlResult = $connect->query($sqlQuery);
Is it possible to somehow reference a specific row by the username, to pull the email and phone values? If not, what is the best way to pull the specific values? This will be done within a foreach loop where the username is pulled from another source.