function getSection($id) { $result = $connector->query("SELECT * FROM section WHERE `sec_id` = '{$id}'"); $row = $connector->fetchArray($result); if ($result = mysql_query($query)) { $section = new section(); $section->setSec_id($row['sec_id']); $section->setSec_title($row['sec_title']); $section->setSec_url($row['sec_url']); $section->setSec_order($row['sec_order']); $section->setSec_despription($row['sec_despription']); return $post; } else { echo mysql_errno() . ": " . mysql_error() . "\n"; } }