Mysqli Query没有返回任何结果

I seem to be having trouble getting mysqli to return a result from my query. My code is:

$db_conn = get_database(); //function returns a static mysqli object reference

if($result = $db_conn->query("SELECT city 
                                FROM state 
                               WHERE name='CA' ")) {
  $row = $result->fetch_object();
  $city= $row->city;
  $result->close();
} else {
  echo $db_conn->error;
}

When I echo the contents of the city variable, it contains nothing.

  1. Check get_database() to make sure the proper database is selected
  2. The column state in your where clause is the same as your table name, state. Change that to name instead if you can.