$id =isset($_GET['id'])?$_GET['id']:'';
if(!is_numeric($id) ){
exit("<script>alert('對不起,你所訪問的使用者不存了!'); history.back();</script>");
}else{
$sql ="select * from wk_member where id='$id' ";
mysql教程_query("update wk_member set m_hit=m_hit+1 where id='$id'");
mysql_query("update wk_works set w_browse=w_browse+1 where m_id='$id'");
$result =mysql_query($sql) or die(mysql_error());
if( mysql_num_rows($result) ){
$rs =mysql_fetch_array($result);
$no =$rs['m_uid'];
$hit=$rs['m_hit'];
mysql_free_result($result);
$sql ="select * from wk_works where m_id='$id'";
$result =mysql_query($sql) or die(mysql_error().$sql);
$w_dec ='未寫宣言';
$w_head ='images/head.gif';
$w_support =0;
$w_blog ='作者還未上傳作品';
if(mysql_num_rows($result)){
$rs =mysql_fetch_array($result);
$w_support =$rs['w_support'];
$w_browse =$rs['w_browse'];
$w_dec =$rs['w_dec'];
$w_head =$rs['w_lt'];
$w_blog =$rs['w_blog'];
}
}else{
exit("<script>alert('對不起,你所訪問的使用者不存了!'); history.back();</script>");
}
}
資料庫教程連接程式
mysql_connect('localhost','root','1******') or die('database server no exists!');
mysql_select_db('wk') or die('database error!');
mysql_query("SET NAMES 'gbk'");//set document charset encode
站長指定,這款沒什麼好指定的嘍,是基本的mysql查詢,然後取得結果賦值給了相對應的變數了。