在线等!!!急急急!请高手多多关照!!:-)

worksworks 2006-01-24 03:58:39
$dbh=mysql_connect('****','****','*****');
if(!$dbh)
{
echo "没连接到数据库".strval($dbh);
exit;
}
$query="select newsdate,edition,count(*)
from record,rec_user
where ru_iuser='".$_SESSION["logname"]."'
and date_format(ru_idate,'%m %d, %y')='".$strDate."'
and ru_id=recid
group by newsdate,edition
order by newsdate,edition";
$rsh=mysql_db_query('paper',$query,$dbh);

if (!($row==false))
{
print "<th>序号</th>";
print "<th>报纸日期</th>";
print "<th>所属版面</th>";
print "<th>标著总数</th>";
$index=0;
$totPap=0;
$totSum=0;
$strOld="";
while(!($row==0))
{

$index=$index+1;
print "<tr>";
print "<td>".$index."</td>";//序号
$strTmp=(0).$Value;
print "<td>".$strTmp."</td>";//报纸日期
if ($strTmp!=$strOld)
{

$totPap=$totPap+1;
$strOld=$strTmp;
}

$strTmp=(1).$Value;
print "<td>第 ".$strTmp." 版</td>";//所属版面
$strTmp=(2).$Value;
print "<td>".$strTmp." 条</td>";//标著总数
$totSum=$totSum+intval($strTmp);
print "</tr>";
$row=mysql_fetch_array($rsh);

}
print "<tr>";
print "<td><b>统计</b></td>";
print "<td>共 ".$totPap." 期</td>";
print "<td>总 ".$index." 版</td>";
print "<td>共 ".$totSum." 条</td>";
print "</tr>";
}
else
{
print "无数据";
}


?>
...全文
83 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
ice_berg16 2006-01-24
  • 打赏
  • 举报
回复
开始没定义$row,if (!($row==false))

$strTmp=(0).$Value;这种写法肯定是错的。
worksworks 2006-01-24
  • 打赏
  • 举报
回复
是"报纸日期"!!
xuzuning 2006-01-24
  • 打赏
  • 举报
回复
从哪里弄来的代码???

$strTmp=(0).$Value;
是什么意思???
worksworks 2006-01-24
  • 打赏
  • 举报
回复
高手们,帮帮忙呀!!!在线等!! :-)
worksworks 2006-01-24
  • 打赏
  • 举报
回复
要么是我的判断有问题???
worksworks 2006-01-24
  • 打赏
  • 举报
回复
我的数据库连接是对的,是不SQL语句错了呀!!If后面的表格输出不了.高手们帮帮忙呀!!!谢谢!!

21,891

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧