運行PHP項目顯示空白
千落
千落 2021-01-20 12:50:46
0
1
1146

我主要的問題就是以前用xampp能運行的php專案現在運行不了,能顯示html,部分不需要連接資料庫的php頁面也能顯示,只要是需要連接資料庫的都不行,完全不知道什麼原因,求大佬們去救孩子吧!

下面是連接資料庫的程式碼:

<?phperror_reporting(0); //資料庫連結檔案$host='127.0.0.1';//資料庫伺服器$user='root ';//資料庫使用者名稱$password='';//資料庫密碼$database='kaoshi';//資料庫名稱$conn=@mysqli_connect($localhost,$user,$password) or die('資料庫連線失敗!');@mysql_select_db($database) or die('沒有找到資料庫!');

mysql_query("設定名稱 '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 )   {    ?> <選項值=“<?php echo mysql_result($query,$fi,0);?>”><?php echo mysql_result($query,$fi,0);?></選項> <選項值=“”>請選擇 0)  {   for ($fi=0;$fi<$rowscount;$fi )   {    ?> <選項值=“<?php echo mysql_result($query,$fi,0);?>” 0)  {       echo "value='".mysql_result($query,0,0)."'"; } }}函數makefilename2(){    $i=1; $str = "0123456789"; //   輸出字元集 $n = 4; //   輸出串長度 $len = strlen($str)-1; for($i=0 ; $i<$n; $i ){ $s .=  $str[rand(0,$len)]; $timestamp=時間();返回$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); }}函數 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都在用~

熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!