What\'s the best way with PHP to read a single record from a MySQL database? E.g.:
SELECT id FROM games
I was trying to find an answer in t
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); $db = new mysqli('localhost', 'tmp', 'tmp', 'your_db'); $db->set_charset('utf8mb4'); if($row = $db->query("SELECT id FROM games LIMIT 1")->fetch_row()) { //NULL or array $id = $row[0]; }