報表-php讀取資料庫報錯,讀取不出來(附原始碼)

來源:互聯網
上載者:User
關鍵字 php 報表 資料庫
php報表資料庫

提示錯誤:

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\yxweb\yjjh\B\dis_ck.php on line 47

起沒查詢前期報表

源碼:
date_default_timezone_set('Asia/Shanghai');//Asia/Shanghai
$sj=date("Y-m-d");//取前期
//echo $sj;
$gq=0;
$bb=0;
if(!empty($_POST['sj'])){
$sj=$_POST['sj'];
//$sj="$sj[6]"."$sj[7]"."$sj[8]"."$sj[9]"."-"."$sj[0]"."$sj[1]"."-"."$sj[3]"."$sj[4]";
}
if(!empty($_POST['gq'])){
$gq=$_POST['gq'];
}
if(!empty($_POST['bb'])){
$bb=$_POST['bb'];
}
//echo"

$sj, $gq, ";
$sql=mysql_query("select * from $bb where gq='$gq' and sj like'$sj%' order by id desc ");
$info=mysql_fetch_array($sql);
if($info==false){

//echo"

$array

";

echo "

起沒查詢前期報表

";
}
elseif($bb=='yl'){
$sqlyl=mysql_query("select * from yl where gq='$gq' and sj like '$sj%' order by id desc limit 1");
//echo $sqlfzb;
$info=mysql_fetch_array($sqlyl);
?>
  • 相關文章

    聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.