PHP头条
热点:

报表-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);
?>

www.phpzy.comtrue/php/3181.htmlTechArticle报表-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 起没查询前期报...

相关文章

相关频道:

PHP之友评论

今天推荐