Home >Backend Development >PHP Tutorial >报表-php读取数据库报错,读取不出来(附源代码)

报表-php读取数据库报错,读取不出来(附源代码)

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-02 11:27:371094browse

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);
?>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn