App\services\Database::getNumRows PHP Method

getNumRows() public method

public getNumRows ( $key, $value, $table = null )
    public function getNumRows($key, $value, $table = null)
    {
        $table = $table ?: $this->tableName;
        $sql = "SELECT * FROM {$table} WHERE {$key}='{$value}'";
        return $this->query($sql)->num_rows;
    }