php - Mysqli Query is not returning any result -


i seem having trouble getting mysqli return result query. code is:

$db_conn = get_database(); //function returns static mysqli object reference  if($result = $db_conn->query("select city                                  state                                 name='ca' ")) {   $row = $result->fetch_object();   $city= $row->city;   $result->close(); } else {   echo $db_conn->error; } 

when echo contents of city variable, contains nothing.

  1. check get_database() make sure proper database selected
  2. the column state in clause same table name, state. change name instead if can.

Comments

Popular posts from this blog

Cursor error with postgresql, pgpool and php -

delphi - ESC/P programming! -

c++ - error: use of deleted function -