Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RECORD NUMBER!

Status
Not open for further replies.

selena1

Programmer
Apr 7, 2003
69
I use Paradox database. But I have had some problems, so have decided to start using MySQL database. Problem that I had with Paradox database, was that after filtering some table, with TTable or TQuery component in Delphi, property RecNo (record number) was incorrect. For example: if I retriveve 5 records from the table that has 10 records, and after thet use property RecNo to get information:

Record 1 of 5, Record 2 of 5, ............,

as a result I can get:

Record 7 of 5.

So, property RecNo has value of real position of the record in complete table, not value of position of the record in filtered dataset. If I start using MySQL database can I solve this problem?

Cheers!
 
I'm not familiar with Paradox...but are you using this with a website, or other programming language?

If you are, and you are pulling this information in a query, I would assume you could just put the returned information in a query, and parse through the array, counting with a variable as you looped through the array.

You may not need to change to MySQL.
In MySQL/PHP this wouldlike the following...I this retrieves the top ten downloaded items by crossing the downloads table and the items table..

$query =" SELECT item.item_id, item.item_name, Count(*) as num_downloads
FROM items, downloads
WHERE items.item_id=downloads.item_id
GROUP BY item_id
ORDER BY num_downloads DESC
LIMIT 0,10";

$i=1;
$query_result = mysql_query($query,$dbh);
while($query_array = mysql_fetch_array($query_result))
{
print($i.') <a href=&quot;/items.php?action=view&amp;item_id='.$query_array[0].'&quot;>'.$query_array[1].'</a><BR>');
$i++
}

In this example, the variable $i counts up one with each itteration through the loop, and prints the number to the screen, along with a link to the item listed.

***************************************
J. Jacobs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top