国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術(shù)文章
文章詳情頁

運(yùn)行PHP項(xiàng)目顯示空白

瀏覽:128日期:2022-06-03 14:52:50

問題描述

我主要的問題就是以前用xampp能運(yùn)行的php項(xiàng)目現(xiàn)在運(yùn)行不了,能顯示html,部分不需要連接數(shù)據(jù)庫的php頁面也能顯示,只要是需要連接數(shù)據(jù)庫的都不行,完全不知道什么原因,求求大佬們救救孩子吧!

下面是連接數(shù)據(jù)庫的代碼:

<?phperror_reporting(0); //數(shù)據(jù)庫鏈接文件$host='127.0.0.1';//數(shù)據(jù)庫服務(wù)器$user='root';//數(shù)據(jù)庫用戶名$password='';//數(shù)據(jù)庫密碼$database='kaoshi';//數(shù)據(jù)庫名$conn=@mysqli_connect($localhost,$user,$password) or die('數(shù)據(jù)庫連接失敗!');@mysql_select_db($database) or die('沒有找到數(shù)據(jù)庫!');

mysql_query("set names 'gb2312'");function getoption($ntable,$nzd){ $sql="select ".$nzd." from ".$ntable." order by id desc"; $query=mysql_query($sql); $rowscount=mysql_num_rows($query); if($rowscount>0) { for ($fi=0;$fi<$rowscount;$fi++) { ?> <option value="<?php echo mysql_result($query,$fi,0);?>"><?php echo mysql_result($query,$fi,0);?></option> <?php } }}function getoption2($ntable,$nzd){ ?> <option value="">請(qǐng)選擇</option> <?php $sql="select ".$nzd." from ".$ntable." order by id desc"; $query=mysql_query($sql); $rowscount=mysql_num_rows($query); if($rowscount>0) { for ($fi=0;$fi<$rowscount;$fi++) { ?> <option value="<?php echo mysql_result($query,$fi,0);?>" <?php if($_GET[$nzd]==mysql_result($query,$fi,0)) { echo "selected"; } ?>><?php echo mysql_result($query,$fi,0);?></option> <?php } }}function getitem($ntable,$nzd,$tjzd,$ntj){ if($_GET[$tjzd]!="") { $sql="select ".$nzd." from ".$ntable." where ".$tjzd."='".$ntj."'"; $query=mysql_query($sql); $rowscount=mysql_num_rows($query); if($rowscount>0) { echo "value='".mysql_result($query,0,0)."'"; } }}function makefilename2(){ $i=1; $str = "0123456789"; // 輸出字符集 $n = 4; // 輸出串長(zhǎng)度 $len = strlen($str)-1; for($i=0 ; $i<$n; $i++){ $s .= $str[rand(0,$len)]; } $timestamp=time(); return $timestamp.$s; } function readzd($ntable,$nzd,$tjzd,$ntj){ $sql="select ".$nzd." from ".$ntable." where ".$tjzd."='".$ntj."'"; $query=mysql_query($sql); $rowscount=mysql_num_rows($query); if($rowscount>0) { echo mysql_result($query,0,0); }}function readzd2($ntable,$nzd,$tjzd,$ntj){ $sql="select ".$nzd." from ".$ntable." where ".$tjzd."='".$ntj."'"; $query=mysql_query($sql); $rowscount=mysql_num_rows($query); if($rowscount>0) { return mysql_result($query,0,0); }}?>

問題解答

回答1:

下載phpstudy吧, 國人phper都在用~

相關(guān)文章:
主站蜘蛛池模板: 长治县| 安徽省| 孟村| 定边县| 白朗县| 井研县| 亚东县| 璧山县| 北辰区| 高邮市| 延川县| 华亭县| 横山县| 宿州市| 沭阳县| 类乌齐县| 施甸县| 巫山县| 舟曲县| 上犹县| 阜康市| 盐津县| 汶上县| 福清市| 大庆市| 襄垣县| 茂名市| 金湖县| 札达县| 贵定县| 榕江县| 容城县| 公主岭市| 揭东县| 遂平县| 张家港市| 阿合奇县| 天津市| 泽普县| 华坪县| 辽宁省|