PHP-MySQLi-Database-Class icon indicating copy to clipboard operation
PHP-MySQLi-Database-Class copied to clipboard

how set LIMIT 5 OFFSET 3 ?

Open khanhnam99 opened this issue 1 year ago • 1 comments

how set LIMIT 5 OFFSET 3 ?

khanhnam99 avatar Nov 09 '23 03:11 khanhnam99

    /**
     * A convenient SELECT * function.
     *
     * @param string       $tableName The name of the database table to work with.
     * @param int|array    $numRows   Array to define SQL limit in format Array ($offset, $count)
     *                                or only $count
     * @param string|array $columns   Desired columns
     *
     * @return array|MysqliDb Contains the returned rows from the select query.
     * @throws Exception
     */
    public function get($tableName, $numRows = null, $columns = '*')
    {
     * @param int|array    $numRows   Array to define SQL limit in format Array ($offset, $count)
<?php
...
$users = $db->get('users', [3,5]); // LIMIT 5 OFFSET 3

Good day

huseyinaslim avatar Jan 23 '24 21:01 huseyinaslim