(做为现在的主流开发语言)
global $db;
$poll = $db->getRow("select * from TBL_POLL order by poll_id desc limit 1");
$poll_id = $poll["poll_id"];
$pollitems = $db->getAll("select * from TBL_POLLITEM where poll_id=$poll_id");
?>
服务器端
function poll($formData){
global $db;
$tmp="";
$objResponse = new xajax(动态网站静态化)Response();
$poll_id = $formData[poll_id];
$pollitem_id = $formData[pollitem];
if($pollitem_id > 0 && $poll_id > 0) {
$db->query("update ".TBL_POLLITEM." set count=count+1 where pollitem_id = $pollitem_id");
}
$poll = $db->getRow("select * from TBL_POLL where poll_id = $poll_id");
$pollitems = $db->getAll("select * from TBL_POLLITEM where poll_id=$poll_id");
$tmp .="