My MySQL table is simple. I have 3 fields:
- an index
- a url
- a title
making up 20 records.
I'm trying to count the number of rows so that I can paginate with PHP. But count(*) is returning more than the number of rows that are there, 142 total. I get the same results counting the index.
What am I missing?
edit
Sorry for the previous lack of information, quite frankly I'm embarrassed by all this and feel pretty stupid. But here goes.
Field: i, int(11), PRI, NOT NULL, auto_increment
Field: url, text
Field: title, mediumtext
The sql:
select count(*) from $table
The php:
require_once('highlights_db.php');
$query = "select count(*) from highlights";
$connection = mysql_connect($host, $user, $pass);
mysql_select_db($db);
$result = mysql_query($query, $connection);
$pages = mysql_fetch_array($result);
$pages = floor($pages);
for($i = 0; $i < $pages; $i++){
echo "<a href=\"\" class=\"page_dot\"></a><br />\n";
}