ThingEngineer / PHP-MySQLi-Database-Class

Wrapper for a PHP MySQL class, which utilizes MySQLi and prepared statements.
Other
3.28k stars 1.35k forks source link

how set LIMIT 5 OFFSET 3 ? #1023

Closed khanhnam99 closed 2 months ago

khanhnam99 commented 8 months ago

how set LIMIT 5 OFFSET 3 ?

huseyinaslim commented 6 months ago
    /**
     * 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