My main problem is that the php projects that used to be run using xampp cannot run now. They can display html, and some php pages that do not need to be connected to the database can also be displayed. As long as they need to be connected to the database, it will not work. I have no idea why. , please big guys, please save the child!
The following is the code to connect to the database:
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 ) { ?> 0) { for ($fi=0;$fi<$rowscount;$fi ) { ?> 0) { echo "value='".mysql_result($query,0,0)."'"; } }}function makefilename2(){ $i=1; $str = "0123456789"; // 输出字符集 $n = 4; // 输出串长度 $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); }}?>
Download phpstudy, Chinese people are all using phper~