That is the warning i get. I am only fetching all the records using SELECT * FROM and then processing it to display as a list. The cursor pointer tries to point to a record set after the last has been parsed. Finally when i view the fetched list the last record is printed twice. Please help ! wacko.gif

To explain, here is the code ...

function db_to_array($table_name) {

$cols = array();
$x=0;
$this_row=0;

$result_all=mysql_query("SELECT * FROM $table_name");
$result_cols = mysql_query("SHOW COLUMNS FROM $table_name");

//mysql_close();

$numfields = mysql_num_fields($result_all);

for($i=0;$i<mysql_num_rows($result_cols);$i++)
{
$cols[] = mysql_result($result_cols, $i);
}

while ($data = mysql_fetch_assoc($result_all))
{
if ($x<$numfields)
{
$x++;
}
else
{
$x = 0;
$this_row++;
}
foreach ($cols as $col_name)
{
$array[$this_row][$col_name] = $data[$col_name];
}

mysql_data_seek($result_all, $this_row); // Line 88 which triggers the title warning
}

return $array;
}

// Test the function...
$test_array = db_to_array($table_name);