query($spost) OR DIE("ERROR $spost"); $rpost=mysqli_fetch_assoc($repost); $npost=mysqli_num_rows($repost); $stag="SELECT * FROM classified_post_tag WHERE post_id='$topic_id'"; $retag=$mysqli->query($stag) OR DIE("ERROR $stag"); $ntag=mysqli_num_rows($retag); $rtag=mysqli_fetch_assoc($retag); $new_view=$rpost['post_view']+1; $upd_view=$mysqli->query("UPDATE classified_post SET post_view='$new_view' WHERE id='$topic_id'") OR DIE("ERROE $upd_view"); ?> | ">

ประกาศอัพเดท

query($supd); $count = 0; while ($rupd = mysqli_fetch_assoc($reupd)) { $posturl = rewrite($rupd['post_title']); //post post_type $stype = "SELECT type FROM `classified_type` WHERE id='$rupd[post_type]'"; $retype = $mysqli->query($stype) or die("ERROR $stype"); $rtype = mysqli_fetch_assoc($retype); //province $sprv = "SELECT classified_post_contact.province_id, province.PROVINCE_ID, province.PROVINCE_NAME FROM `classified_post_contact` "; $sprv .= "LEFT JOIN province ON classified_post_contact.province_id=province.PROVINCE_ID "; $sprv .= "WHERE classified_post_contact.post_id='$rupd[id]'"; $reprv = $mysqli->query($sprv) or die("ERROR $sprv"); $rprv = mysqli_fetch_assoc($reprv); $urlprv = rewrite($rprv['PROVINCE_NAME']); //category $scate = "SELECT id, cate_name FROM `category` WHERE id='$rupd[cate_id]'"; $recate = $mysqli->query($scate) or die("ERROR $scate"); $rcate = mysqli_fetch_assoc($recate); $postcate = rewrite($rcate['cate_name']); // sub category $ssub = "SELECT id, sub_cate_name FROM `sub_category` WHERE id='$rupd[sub_cate_id]'"; $resub = $mysqli->query($ssub) or die("ERROR $ssub"); $rsub = mysqli_fetch_assoc($resub); $postscate = rewrite($rsub['sub_cate_name']); $spic = "SELECT picshow FROM `classified_post_img` WHERE post_id='$rupd[id]'"; $repic = $mysqli->query($spic) or die("ERROR $spic"); $rpic = mysqli_fetch_assoc($repic); if ($count < 6) { //get img from content if no rpic if ($rupd['post_type'] === '10') { $spre = "SELECT classified_post.id, classified_post.post_title,classified_post.post_detail, classified_post.post_price_type, classified_post.post_price, classified_post.post_date, classified_video.video_url "; $spre .= "FROM classified_post, classified_video WHERE classified_post.id = classified_video.post_id AND classified_video.post_id = '$rupd[id]' ORDER BY post_update DESC limit 1"; $repre = $mysqli->query($spre) or die("ERROR $spre"); $rpre = mysqli_fetch_assoc($repre) ?>