首 页   · 站长博客 · 用户注册 · 会员登陆  · 会员排行  ·最新主题  ·最近回复  精华区  版权声明  ·论坛管理
  当前登录身份:游客,请先登录。  笔名: 口令: 验证码:   
楼 主  index »  PHP+MYSQL编程 » [原创]有个问题请教,十分火急!!!!!!!!!!!  


  作者:
  注册时间:2005-03-24
  主题/回复:2/2
  积分:412
  等级:★★☆(五级)
  称号:略有小成

  eg1516513@yahoo...
  120163207
  free3.e-168.cn/full-eg

 

 发表:2005-04-01 01:30:27 阅读 2009 次 回复 2 次 得分1  |   字号 字色
[原创]有个问题请教,十分火急!!!!!!!!!!!
我买个程序,有个地方老是显示不出来,不知道什么原因,尤其是标示*的地方,就是把其中的变量换成常数,也显示不了。大家帮忙看看,急!!
<?
include "user.id.inc.php";
if($user_id){
if(!$year) $year=date(Y);
if(!$month) $month=date(m);
?>
<form name=lines action=spends.inc.php method=post>
<input type=hidden name=plid value="<?=$plid?>">
<input type=hidden name=id value="<?=$id?>">
<TABLE cellSpacing=0 cellPadding=0 border=0 width=100%>
<TBODY>
<TR>
<TD colSpan=5 class=tablecontentbewel>
<?
include "month.input.inc.php";
?>
</TD>
</TR>
<TR>
<TD colSpan=5 class=tableheadharddark>
<P>
<?=($plid==$PLAN_ID_PERIOD)?$def_fast_plan:""?>
Spent records of "<?=$user_name?>"
<?=(!$plid)?"- Note that amount in red indicates $def_fast_plan":""?>
</P>
</TD>
</TR>
<TR>
<TD class=tablesubheaddark height=21>Transaction</TD>
<TD class=tablesubheaddark height=21>Date</TD>
<TD class=tablesubheaddark height=21>Days</TD>
<TD class=tablesubheaddark height=21>Note</TD>
<TD class=tablesubheaddark height=21 align=right>Amount</TD>
</TR>
/********************这上面的还可以显示****************/
<?
if($plid) $c_plan_type = "and plan_type='$plid'";
$date_field = "date";
include "month.clause.inc.php";

$query = "select id, plan_type, pmt_id, date_format($date_field,'%Y-%m-%d') as day,
to_days(now())-to_days($date_field) as days, pmt_note, exchange
from hyip_lines where uid=$user_id and status='$STATUS_ENUM_ENABLE' 
and pmt_type='$TRANS_ENUM_SPEND'
$c_plan_type $c_month $c_year order by $date_field desc";

$result = mysql_query($query) or die(" ");
$sum = 0;
while($line=mysql_fetch_array($result)){
$amount = number_format($row[exchange],2);
$sum += $amount;
$pmt_id = "<a href=transaction.php?id=$line[pmt_id]>$line[pmt_id]</a>";
/*******************这里面的不能显示************************/
echo "<TR>
<TD class=tablecontentbeweldark height=20>$pmt_id</TD>
<TD class=tablecontentbeweldark height=20>$line[day]</TD>
<TD class=tablecontentbeweldark height=20>$line[days]</TD>
<TD class=tablecontentbeweldark height=20>$line[pmt_note] </TD>
<TD class=tablecontentbeweldark height=20 align=right>$amount</TD>
</TR>";
}
?>
<TR>
/********************************************************/
<TD colspan=4 class=tablecontentbeweldark height=7 align=right>Page Total</TD>
<TD class=tablecontentbeweldark height=7 align=right><b><?=$sum?></b></TD>
</TR>
</TBODY>
</TABLE>
</form>
<?}?>
 
 1#楼  
 
  回复人:一起PHP
  注册时间:2004-02-27
  主题/回复:247/1521
  积分:4649
  等级:★★★★★☆(十一级)
  称号:论坛圣人

   
 1#楼 发表于2005-04-01 18:05:02  评分:1 

代码太长,而且不完整(用到了好几个包含文件),找错误难度太大。很多变量都不知道从哪里来的,干什么用的。
 2#楼  
 
  回复人:一起PHP
  注册时间:2004-02-27
  主题/回复:247/1521
  积分:4649
  等级:★★★★★☆(十一级)
  称号:论坛圣人

   
 2#楼 发表于2005-04-01 18:10:25  评分: 

你可以自己试着调试一下,比如你说的
$pmt_id = "<a href=transaction.php?id=$line[pmt_id]>$line[pmt_id]</a>";
/*******************这里面的不能显示************************/ 
echo "<TR>
<TD class=tablecontentbeweldark height=20>$pmt_id</TD>
<TD class=tablecontentbeweldark height=20>$line[day]</TD>
.............

既然$pmt_id已经有值了,就是“<a href=....”,在下面应该可以显示,
你可以试着在$pmt_id=......下面加一行 echo $pmt_id;看看这个变量是否有内容,如果这里可以输出,而放到下面就无法输出,那么可以修改一下输出方法,比如把"<tr><td class=......>$pmt_id</td>"改为:"<tr><td....>".$pmt_id."</td>"

上面只是个例子,总之就是你可以自己试着调试一下,像这样的已经写好的,而且不全面的代码片断,查错是相当困难的,谁写的代码谁最清楚,别人分析起来难度比较大。你自己试着调试一下吧。 
  页数1/1首页 « 1 » 末页
  发表回复:您还没有登陆,无法发表回复。请先[登陆]

一起PHP技术联盟 主办:一起PHP 联系方式:站长QQ:4304410 QQ群:8423742 20159565 站长博客 E-mail: nqp@nqp.me 执行时间:0.009sec
SimsmaBBS 2008 (v6.0) Developed by 17php.com,Copyright(C)2003-2010 All rights reserved. 副本授权:一起PHP官方专用版