急!帮我看看这个问题

Cain 2003-08-22 11:04:59
<?
$StrSql="select new_confesstype.id as id,new_confesstype.type as new_type from new_confesstype,new_fabu where new_confesstype.id=new_fabu.typeid";
$Result=mysql_query($StrSql,$Server) or die($StrSql);

$Num=mysql_num_rows($Result);


while($Row=mysql_fetch_object($Result))
{

$a[$Row->id]=$Row->new_type;
}

if($Num=="")
{
echo "没有记录";
}else
{
$PageSize=12;
$i=0;
$StrSql="select * from new_fabu where 1 and typeid=$typeid order by id desc";
$Result=mysql_query($StrSql,$Server) or die( $StrSql);

$TotalPages=ceil($Num/$PageSize);
if($CurPage<1) $CurPage=1;
if($CurPage>$TotalPages) $CurPage=$TotalPages;
if($CurPage>1) mysql_data_seek($Result,($CurPage-1)*$PageSize);

while(($Row=mysql_fetch_object($Result))&&($i<$PageSize))
{
$con=substr($Row->specify,0,100);
$Print.="
<table width=\"619\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"80\">
<tr>
<td align=\"center\" class=\"unnamed2\" height=\"30\">
<table width=\"619\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"30\">
<tr align=\"center\" valign=\"middle\">

<td width=\"140\" class=\"unnamed2\"><font color=\"#009900\">【".$A[$Row->typeid]."】</font></td>
<td class=\"unnamed2\" width=\"400\" align=\"left\"> $Row->title $Row->addtime</td>
<td width=\"140\" class=\"unnamed2\">$Row->province $Row->city</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height=\"50\" align=\"left\" valign=\"top\" class=\"unnamed2\">
<table width=\"619\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"50\">
<tr>
<td width=\"80\"> </td>

<td align=\"left\" valign=\"top\" class=\"unnamed3\" width=\"539\"><a href=\"shichangdongtai_gongqiu1.php?ID=$Row->id\">$con...</a></td>
</tr>
</table>
</td>
</tr>
</table>
";
$i++;
}
}


$Page=preg_replace("/>$CurPage /","><font color=#FF0000>$CurPage</font> ",$Page);
if($CurPage<=1)
{
$Prev=$CurPage;
}else{
$Prev=$CurPage-1;
}
if($CurPage>=$TotalPages)
{
$Next=$CurPage;
}else{
$Next=$CurPage+1;
}

if($submit)
{
header("location:shichangdongtai_gongqiu.php?typeid=$typeid&&CurPage=$goto");//这里$typeid没有值,我该怎么改?
}


$c="1 or typeid=2 or typeid=3 or typeid=4 or typeid=5";
$tpl=new EasyTemplate("shichangdongtai_gongqiu.htm");
$tpl->assign("search",getsearch($Addtime,$Typeid,$City));
$tpl->assign("NNTop",$NNTop);
$tpl->assign("NTop",$NTop);
$tpl->assign("gongqiu_list",$Print);
$tpl->assign("Num",$Num);
$tpl->assign("TP",$TotalPages);
$tpl->assign("CP",$CurPage);
$tpl->assign("LP","shichangdongtai_gongqiu.php?typeid=$typeid&&CurPage=$TotalPages");
$tpl->assign("Prev","shichangdongtai_gongqiu.php?typeid=$typeid&&CurPage=$Prev");
$tpl->assign("Next","shichangdongtai_gongqiu.php?typeid=$typeid&&CurPage=$Next");

$tpl->assign("all","shichangdongtai_gongqiu.php?typeid=$c");
$tpl->assign("supplier","shichangdongtai_gongqiu.php?typeid=2");
$tpl->assign("procure","shichangdongtai_gongqiu.php?typeid=1");
$tpl->assign("teamwork","shichangdongtai_gongqiu.php?typeid=3");
$tpl->assign("agency","shichangdongtai_gongqiu.php?typeid=4");
$tpl->assign("enrol","shichangdongtai_gongqiu.php?typeid=5");
$tpl->easy_print();

?>
除了我标出来的$typeid值无法传递到if($submit)里之外,当我翻页的时候,会有这个错误:
Warning: Offset 12 is invalid for MySQL result index 3 in /www/users/focusforever.com/qiye/commercialservice/marketing/shichangdongtai_gongqiu.php on line 36
我该怎么办?
...全文
52 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
myblessu 2003-08-22
  • 打赏
  • 举报
回复
这么长,晕.
Cain 2003-08-22
  • 打赏
  • 举报
回复
另外
extract($_GET);
extract($_POST);
是什么意思啊?
Cain 2003-08-22
  • 打赏
  • 举报
回复
不行啊~~~~~
他还是select * from new_fabu where 1 and typeid= order by id desc
xuzuning 2003-08-22
  • 打赏
  • 举报
回复
开始处加上
extract($_GET);
extract($_POST);


<?
extract($_GET);
extract($_POST);
$StrSql="select new_confesstype.id as id,new_confesstype.type as new_type from new_confesstype,new_fabu where new_confesstype.id=new_fabu.typeid";
$Result=mysql_query($StrSql,$Server) or die($StrSql);
。。。

另外判断是否返回空记录应在
while($Row=mysql_fetch_object($Result))
{

$a[$Row->id]=$Row->new_type;
}
之前,已然没有记录还做他干吗?

21,886

社区成员

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

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