How about
$name = $mysqli->query("SELECT name FROM contacts WHERE id = 5")->fetch_object()->name;
More Related Contents:
- SELECT COUNT(*) AS count – How to use this count
- Mysqli update throwing Call to a member function bind_param() error [duplicate]
- mysqli bind_param() expected to be a reference, value given
- Should I manually check for errors when calling “mysqli_stmt_prepare”?
- mysqli_real_escape_string() expects exactly 2 parameters, 1 given
- INSERT – Number of bind variables doesn’t match number of fields in prepared statement
- Call to a member function execute() on boolean in [duplicate]
- SSL operation failed with code 1: dh key too small
- Can’t pass mysqli connection in session in php
- PHP Fatal error: Call to undefined function mysqli_stmt_get_result()
- how to bind multiple parameters to MySQLi query [closed]
- mysqli ignoring the first row in a table
- Returning Multiple Rows with MySqli and Arrays
- mySQLi prepared statement unable to get_result()
- mysqli_select_db() expects parameter 1 to be mysqli, string given
- What does the mysqli_error() expects parameter 1 to be mysqli, null given mean?
- Mysqli prepared statement column with variable [duplicate]
- How to fetch all in assoc array from a prepared statement?
- Fatal error: Call to undefined function mysqli_result()
- Fatal error: Call to undefined method mysqli_stmt::fetch_array() [duplicate]
- Why I am getting an error when using w3school tutorial? [duplicate]
- Using wildcards in prepared statement
- mysqli_connect(): (HY000/2002): No connection could be made because the target machine actively refused it
- How to remove the fatal error when fetching an assoc array
- Fatal error: Call to undefined method mysqli_stmt::get_result()
- PHP MySQLi Multiple Inserts
- Fatal error: Call to a member function prepare() on a non-object in
- Using Prepared Statement, how I return the id of the inserted row?
- Is there any way to print the actual query that mysqli->execute() makes?
- When should I close a database connection in PHP?