Convert the code from PHP to Ruby on rails
- by theband
public function getFtime() {
$records=array();
$sql="SELECT * FROM `finishedtime`";
$result=mysql_query($sql);
if(!$result){throw new Exception(mysql_error());}
if(mysql_num_rows($result)==0){return $records;}
while($row=mysql_fetch_assoc($result)){$records[]=$row;}
return $records;
}
…