Number of Lines in Table.

From: Date: Wed, 03 Sep 2014 02:37:57 +0000
Subject: Number of Lines in Table.
Groups: php.db 
Request: Send a blank email to php-db+get-48912@lists.php.net to get a copy of this message
Dear List - This works: mysql> describe Purchases; +-------+-------------+------+-----+---------+----------------+
| Field | Type        | Null | Key | Default | Extra          |
+-------+-------------+------+-----+---------+----------------+
| indx  | smallint(6) | NO   | PRI | NULL    | auto_increment |
| manf  | varchar(20) | YES  |     | NULL    |                |
| itm   | varchar(50) | YES  |     | NULL    |                |
| prc   | float       | YES  |     | NULL    |                |
+-------+-------------+------+-----+---------+----------------+ 4 rows in set (0.00 sec) SELECT SQL_CALC_FOUND_ROWS itm FROM Purchases LIMIT 500 OFFSET 0; +------------------------------------------+
| itm                                      |
+------------------------------------------+
| BT-300. Host interface: USB              |
| Oregano                                  |
| Fancy Paprika                            |
| Fancy Paprika                            |
| <snip>
| Oregano                                  |
| Oregano                                  |
| Oregano                                  |
| Oregano                                  |
| Basil                                    |
+------------------------------------------+ 453 rows in set (0.00 sec) mysql> SELECT FOUND_ROWS(); +--------------+ | FOUND_ROWS() | +--------------+
|          453 |
+--------------+ 1 row in set (0.00 sec)
This does not:
$sql26 = "SELECT SQL_CALC_FOUND_ROWS itm FROM Purchases LIMIT 50 OFFSET 0"; if (!mysqli_query($cxn, $sql26))
    printf("Errormessage: %s\n", mysqli_error($cxn));
$result26 = mysqli_query($cxn, $sql26); $sql27 = "SELECT FOUND_ROWS()"; if (!mysqli_query($cxn, $sql27))
    printf("Errormessage: %s\n", mysqli_error($cxn));
$result27 = mysqli_query($cxn, $sql27); $row27 = mysqli_fetch_row($result27); print_r($row27); //output Array (
    [0] => 1
) What is my error? TIA Ethan

« previous php.db (#48912) next »