X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdba.php;h=c7b598f2d68e09ed2f3a9ead81d25d23f00d7265;hb=fd3cf1cd02b57e9796e5537dbee468d1c8048a48;hp=a9ed9e5a051bcd2e554828d5c5cca4e38f490b03;hpb=abb827b784e8f9b11e7dd58437d6209bef0d60d2;p=friendica.git diff --git a/include/dba.php b/include/dba.php index a9ed9e5a05..c7b598f2d6 100644 --- a/include/dba.php +++ b/include/dba.php @@ -108,6 +108,23 @@ class dba { return $return; } + /** + * @brief Returns the number of rows + * + * @return string + */ + public function num_rows() { + if (!$this->result) + return 0; + + if ($this->mysqli) { + $return = $this->result->num_rows; + } else { + $return = mysql_num_rows($this->result); + } + return $return; + } + public function q($sql, $onlyquery = false) { global $a; @@ -126,6 +143,8 @@ class dba { $stamp1 = microtime(true); + $sql = "/*".$a->callstack()." */ ".$sql; + if($this->mysqli) $result = @$this->db->query($sql); else