Anyone see any ways to improve this code?
I see a few but don't know how to execute the changes.
$sql = "SELECT name,id,summary,genreid FROM guns ORDER BY id DESC";
$execute = odbc_exec($db,$sql);
$row=0;
while(odbc_fetch_row($execute)) {
if ($row <= 4) {
$name = odbc_result($execute,1);
$id = odbc_result($execute,2);
$summary = str_replace("\\","",odbc_result($execute,3));
$genreid = odbc_result($execute,4);
$row++;
if (strlen($summary) >= 95) {
$summary = substr($summary, "0", "95") . "...";
}
echo "» <a href='gun.php?action=view&id=$id'>$name</a> - $summary<br>";
}
}