【问题标题】:php+oracle, unexpected end of file [duplicate]php + oracle,文件意外结束[重复]
【发布时间】:2017-03-02 15:29:51
【问题描述】:

我有错误:解析错误:语法错误,第 49 行 /var/www/html/daily.php 中的文件意外结束。所有标签都已关闭,第 49 行不存在!我做错了什么?

<body>
<span class="noprint">
<form action="daily.php" method="post">
 <p>time: <input type="text" name="date" value="01.02.2017" pattern="[0-3][0-9].[0-1][0-9].20[0-5][0-9]"/><input type="submit" /><input type="button" value="print" oncli$
</form>
</span>
</body>

<?php
require 'connect.php';
oci_execute($stid);
$stid = oci_parse($conn, "SELECT HK_GOSP.*,  KARD.FIO,  HK_FULL.DIAG,  HK_FULL.GK,  HK_FULL.EXTRA,  HK_FULL.REZ,  HK_FULL.PROBA,  HK_FULL.REAG,  HK_FULL.EF,  HK_FULL.PPK1,  HK_FULL.PPK2,  HK_FULL.PERELIV,  HK_FULL.PPK3,  HK_FULL.REM,  HK_FULL.SGBN, HK_FULL.NPPYEAR AS NPPYEAR1 FROM HK_GOSP,  KARD,  HK_FULL WHERE HK_GOSP.DG LIKE '%" . $_POST['date']  ."%' ");
oci_execute($stid);
?>
<table border='1'>
    <?php
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {

        echo "<tr>\n";
        foreach ($row as $item) {
            echo "    <td>".($item !== null ? htmlentities($item, ENT_QUOTES) : "&nbsp;")."</td>\n";
       echo "</tr>\n";
}
echo "</table>\n";

?>

【问题讨论】:

  • 很确定如果解析器使用 UEOF 向您咆哮,那将是缺少标签或无法关闭循环或类似的东西。至少我看到了一种可能性。
  • '}' 在 echo "&lt;/tr&gt;\n"; 之前丢失

标签: php sql oracle


【解决方案1】:

看起来你缺少一个右括号:

while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {

    echo "<tr>\n";
    foreach ($row as $item) {
        echo "    <td>".($item !== null ? htmlentities($item, ENT_QUOTES) : "&nbsp;")."</td>\n";      
    } // This one here
    echo "</tr>\n";
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-07-27
    • 2017-08-02
    • 1970-01-01
    • 2012-06-10
    • 2017-10-22
    • 1970-01-01
    相关资源
    最近更新 更多