MySQL Forums
Forum List  »  PHP

Re: Mysqli Error for Count (Distinct) Query
Posted by: Peter Brawley
Date: May 25, 2019 06:26PM

Quote

$sql = "SELECT version()";

Got this:

SELECT version() returned no result5.5.14Total

Eh? You need something like ...

$sql = "SELECT version()"; 
$res = mysqli_query( $con, $qry );
if( $res ) {
  $row = mysqli_fetch_row( $res );
  echo "Version: ", $row[0];
}
else echo "Error: ", $con->error, " $qry returned no result";

Options: ReplyQuote


Subject
Written By
Posted
Re: Mysqli Error for Count (Distinct) Query
May 25, 2019 06:26PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.