運(yùn)行PHP項(xiàng)目顯示空白
問(wèn)題描述
我主要的問(wèn)題就是以前用xampp能運(yùn)行的php項(xiàng)目現(xiàn)在運(yùn)行不了,能顯示html,部分不需要連接數(shù)據(jù)庫(kù)的php頁(yè)面也能顯示,只要是需要連接數(shù)據(jù)庫(kù)的都不行,完全不知道什么原因,求求大佬們救救孩子吧!
下面是連接數(shù)據(jù)庫(kù)的代碼:
<?phperror_reporting(0); //數(shù)據(jù)庫(kù)鏈接文件$host='127.0.0.1';//數(shù)據(jù)庫(kù)服務(wù)器$user='root';//數(shù)據(jù)庫(kù)用戶(hù)名$password='';//數(shù)據(jù)庫(kù)密碼$database='kaoshi';//數(shù)據(jù)庫(kù)名$conn=@mysqli_connect($localhost,$user,$password) or die('數(shù)據(jù)庫(kù)連接失敗!');@mysql_select_db($database) or die('沒(méi)有找到數(shù)據(jù)庫(kù)!');
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); }}?>
問(wèn)題解答
回答1:下載phpstudy吧, 國(guó)人phper都在用~
相關(guān)文章:
1. 淺談vue生命周期共有幾個(gè)階段?分別是什么?2. Java EE 6:JSF與Servlet + JSP我應(yīng)該學(xué)習(xí)JSF嗎?3. java - hibernate正向工程生成一對(duì)多關(guān)系模型無(wú)報(bào)錯(cuò),但是只生成了一張表4. java - Spring使用@Autowired失效但是getBean()可以執(zhí)行成功5. javascript - js正則匹配小括號(hào)中的內(nèi)容6. macos - mac下docker如何設(shè)置代理7. index.php錯(cuò)誤,求指點(diǎn)8. 微信開(kāi)放平臺(tái) - android 微信支付后點(diǎn)完成按鈕,后回調(diào)打開(kāi)第三方頁(yè)面,屏幕閃動(dòng),求解決方法9. 微信公眾號(hào)在線生成二維碼帶參數(shù)怎么搞?10. css box-shadow 單邊 單角陰影
