I have an script that I need to select an top 10 from about 500.000 - 1.000.000 records I use MSSQL Server 2008
My website is steed up to use the PDO class but when I try to get top 10 from records my database and webserver gets hanged up and give me execution time exceed error.
If I use mssql class, everyting is fine and works ok, but if I use pdo my website get stucked.
Any ideeas how to make my script work and echo the top 10 I need?
This is my pdo script
$char = $db->prepare("SELECT TOP 10 Name FROM Character ORDER BY PvPLastStandWin DESC");
$char->execute();
foreach($char as $row){
echo $row[0].'<br>';
}