Permalink
Browse files

Fix has_rows() for failing queries

This is used in the installer.

Refs #1117.
  • Loading branch information...
franzliedke committed Jan 6, 2019
1 parent de16e3e commit 9aeaa826b158e86d34d23984c6960b0eb030fa15
Showing with 4 additions and 4 deletions.
  1. +1 −1 include/dblayer/mysqli.php
  2. +1 −1 include/dblayer/mysqli_innodb.php
  3. +1 −1 include/dblayer/pgsql.php
  4. +1 −1 include/dblayer/sqlite.php
@@ -128,7 +128,7 @@ function fetch_row($query_id = 0)
function has_rows($query_id)
{
return mysqli_num_rows($query_id) > 0;
return $query_id ? mysqli_num_rows($query_id) > 0 : false;
}
@@ -141,7 +141,7 @@ function fetch_row($query_id = 0)
function has_rows($query_id)
{
return mysqli_num_rows($query_id) > 0;
return $query_id ? mysqli_num_rows($query_id) > 0 : false;
}
@@ -158,7 +158,7 @@ function fetch_row($query_id = 0)
function has_rows($query_id)
{
return pg_num_rows($query_id) > 0;
return $query_id ? pg_num_rows($query_id) > 0 : false;
}
@@ -177,7 +177,7 @@ function fetch_row($query_id = 0)
function has_rows($query_id)
{
return sqlite_num_rows($query_id) > 0;
return $query_id ? sqlite_num_rows($query_id) > 0 : false;
}

0 comments on commit 9aeaa82

Please sign in to comment.