小白,请指点以下程序怎么不是循环输出的,而且输出的中文还是乱码..
<br /><?<br />$db_host = 'localhost';<br />$db_user = 'root';<br />$db_password = 'root3306';<br />$db_database = 'chuyu';<br />$con = mysql_connect($db_host, $db_user, $db_password);<br />mysql_query("set names 'gb2312'"); <br />if(!$con){die('数据库连接失败: ' . mysql_error());}<br />mysql_select_db($db_database);<br />global $site;<br />$site_data=mysql_query("select * from dh_member_control where id=1",$con);<br />$site=mysql_fetch_array($site_data);<br /><br />$hot_vip_data=mysql_query("SELECT * FROM dh_member WHERE `mck`=1 AND `photo`<>'/images/nan.png' AND `photo`<>'/images/nv.png' ORDER BY `mpower` DESC,`cktime` DESC LIMIT 1,12",$con);<br />$hot_vip=mysql_fetch_array($hot_vip_data);<br />$i=1;<br />while ($hot_vip && $i<=12)<br />{<br />if ($i % 6 == 0){$last=" class=\"last\"";}<br />else{$last="";}<br />$i++;<br />?><br /><li <? echo $last;?> onclick="javascript:location.href='/display/?<? echo $hot_vip["id"]?>.html'"><br /><div class="vpc"><img src="<? echo $hot_vip["photo"]? alt="小白,请指点以下程序如何不是循环输出的,而且输出的中文还是乱码." >" /></div><br /><div class="vpn"><? if (strlen($hot_vip["unick"])>4){echo substr($hot_vip["unick"],1,4);}<br />else{echo $hot_vip["unick"];}<br />if ($hot_vip["mpower"]===2){ echo "<a href=\"/vip/\" title=\"初遇会员\"><img src=\"/images/v.png\" / alt="小白,请指点以下程序如何不是循环输出的,而且输出的中文还是乱码." ></a>";} ?></div><br /><div class="vpt"><? $timediff = strtotime (date("y-m-d")) - strtotime($hot_vip["sri"]) ;<br />echo intval($timediff/(86400*365)) . "岁";<br />echo $hot_vip["add"];?></div><br /></li><br /><? }?>
<br /><?<br />echo '<meta http-equiv="content-type" content="text/html;charset=utf-8">';<br />$db_host = 'localhost';<br />$db_user = 'root';<br />$db_password = 'root3306';<br />$db_database = 'chuyu';<br />$con = mysql_connect($db_host, $db_user, $db_password);<br />mysql_query("set names 'gb2312'"); <br />if(!$con){die('数据库连接失败: ' . mysql_error());}<br />mysql_select_db($db_database);<br />global $site;<br />$site_data=mysql_query("select * from dh_member_control where id=1",$con);<br />$site=mysql_fetch_array($site_data);<br /> <br />$hot_vip_data=mysql_query("SELECT * FROM dh_member WHERE `mck`=1 AND `photo`<>'/images/nan.png' AND `photo`<>'/images/nv.png' ORDER BY `mpower` DESC,`cktime` DESC LIMIT 1,12",$con);<br />#$hot_vip=mysql_fetch_array($hot_vip_data);<br />$i=1;<br />while ($hot_vip=mysql_fetch_array($hot_vip_data) && $i<=12)<br />{<br />if ($i % 6 == 0){$last=" class=\"last\"";}<br />else{$last="";}<br />$i++;<br />?><br /><li <? echo $last;?> onclick="javascript:location.href='/display/?<? echo $hot_vip["id"]?>.html'"><br /><div class="vpc"><img src="<? echo $hot_vip["photo"]? alt="小白,请指点以下程序如何不是循环输出的,而且输出的中文还是乱码." >" /></div><br /><div class="vpn"><? if (strlen($hot_vip["unick"])>4){echo substr($hot_vip["unick"],1,4);}<br />else{echo $hot_vip["unick"];}<br />if ($hot_vip["mpower"]===2){ echo "<a href=\"/vip/\" title=\"初遇会员\"><img src=\"/images/v.png\" / alt="小白,请指点以下程序如何不是循环输出的,而且输出的中文还是乱码." ></a>";} ?></div><br /><div class="vpt"><? $timediff = strtotime (date("y-m-d")) - strtotime($hot_vip["sri"]) ;<br />echo intval($timediff/(86400*365)) . "岁";<br />echo $hot_vip["add"];?></div><br /></li><br /><? }?><br />