Daily Archives: 2012-02-21

一行程序憋死了女汉子

function getDetails($iid)  { global $app; $log = $app->getLog(); $sql = “SELECT * FROM Details where ItemId = :iid ORDER BY id”; try { $db = getConnection(); $stmt = $db->query($sql); $stmt->bindParam(“iid”, $iid); $details = $stmt->fetchAll(PDO::FETCH_OBJ); $db = null; echo  json_encode($details); } catch(PDOException $e) { $log->debug( ‘{“error”:{&#