dousha7645 2014-04-15 14:54
浏览 24
已采纳

PHP与HTML - 解析错误:语法错误,意外'其他'(T_ELSE)

I have a problem with this code. I see other questions on this, but continued without find the mistake. This code work in other computer, but now is giving me problems in my computer. Here is my code, i hope than help me....

        <?PHP 
        include "conexion.php";
        $fecha = date('Y-m-j');
        $ayer = strtotime ( '-1 day' , strtotime ( $fecha ) ) ;
        $ayer = date ( 'Y-m-j' , $ayer );
        $hacedias = strtotime ( '-8 day' , strtotime ( $fecha ) ) ;
        $hacedias = date ( 'Y-m-j' , $hacedias );
        $consulta = "SELECT date_format(fecha,'%d %M') AS FECHA, round((SUM(`TotalMinutos`)/60),1) FROM reporte WHERE  ingeniero ='". $_SESSION['id']."' AND fecha BETWEEN  '$hacedias' AND  '$ayer' GROUP BY fecha";
        $rs = mysql_query($consulta,$conexion);
        if(mysql_num_rows($rs)!=0){
        ?>
        <p></p>
        <p></p>
        <table border="0" cellpadding="1" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100">
            <tr><?PHP
                    $i = 0;
                    while ($reg=mysql_fetch_array($rs)){ 
                    if($i == 8){
                      echo "</tr><tr>";
                      $i = 0;
                    }?>
                <td width="100">
                    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="150">
                      <tr> <td width="80"><B><?=$reg['FECHA']?></B></td>  </tr>
                      <tr> <td width="80"><?=$reg['round((SUM(`TotalMinutos`)/60),1)']?> Horas</td>  </tr>
                    </table>
                </td>
                <?
                $i++;
                }
                ?>
            </tr>
            </table>
            <p>
            <?PHP 
                }else{echo "<h3><p style='color:#FF0000'>ATENCION!!! <br>No has registrado tus tiempos en los ultimos 5 dias.</p></h3>"; }?></table>

Thank you for you help...

  • 写回答

1条回答 默认 最新

  • dongyou2305 2014-04-15 15:02
    关注

    lost semicolon on <?=$reg['FECHA']; ?> and <?=$reg['round((SUM(TotalMinutos)/60),1)']; ?>

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度