I have a number of different php pages. Each one I want to load a different row from the same table in a database.
I am currently using:
[code=php]
<?php
$con = mysql_connect(“localhost”,”root”,”apple123″);
if (!$con)
{
die(‘Could not connect: ‘ . mysql_error());
}
mysql_select_db(“silent-auction”, $con);
$result = mysql_query(“SELECT * FROM lots LIMIT 1”);
mysql_data_seek($result,2);
while($row = mysql_fetch_array($result))
{
echo “<p>Lot Number:” . $row[‘lot-number’] . “</p>”;
echo “<p>Bid: £” . $row[‘bid’] . “</p>”;
}
mysql_close($con);
?>
This works fine for the first page, just displaying the first row in the table.
The second and thrid pages contiue to only show the first row from the database, but with the following error:
[CODE]Warning: mysql_data_seek() [function.mysql-data-seek]: Offset 2 is invalid for MySQL result index 3 (or the query data is unbuffered) in C:Program Filesxampphtdocssilent-auction3.php on line 22
Anyone have any ideas?