doutan5844 2015-09-16 10:14
浏览 35

PHP在执行脚本后返回空白页面

This code was working perfectlty as most of you said. I had a little issue with the path pointing to this script. The problem now is that I am having issues with the hyperlink with the href code line. I have a field in my database that is labled fulltext . I am trying to create a script that allows me display the content of fulltext (echo "{$row['fulltext']}.";) when I click on the Read More button. The hyperlink should be populated with the echo "{$row['title']}."; What mistake am I making by inserting a href="fulltext.php?=$row['fulltext']

<table>
<?php
    $dbhost = 'localhost';
    $dbuser = 'myusernm';
    $dbpass = 'mypwd';

    $conn = mysql_connect($dbhost, $dbuser, $dbpass);

    if(! $conn )
    {
        die('Could not connect: ' . mysql_error());
    }

    $sql = 'SELECT title, introtext, created, created_by, catid FROM      mydb_items';
    mysql_select_db('muslimtimes360');
    $retval = mysql_query( $sql, $conn );

    if(! $retval )
    {
        die('Could not get data: ' . mysql_error());
    }

    while($row = mysql_fetch_array($retval, MYSQL_ASSOC))
    {
        echo '<tr>'; echo '<td>'; echo '<span class="post-date">'; echo   "{$row['created']}."; echo '</span>'; echo '</td>'; echo '</tr>';
        echo '<tr>';
        echo '<td>'; echo '<h2 class="blog-post-title">'; echo "{$row['title']}."; echo '</h2>'; echo '</td>';
        echo '</tr>';
        echo '<tr>';
        echo '<td>'; echo '<p>'; echo "{$row['introtext']}."; echo '</p>'; echo '</td>'; echo '</tr>';

        echo '<p>'; echo '<tr>';
        echo '<td>'; echo '<a href="#">'; echo '<input type="button" value="Read More" />'; echo '</a>'; echo '</td>';
        echo '</tr>';
        echo '</div>';
        echo '<div class="blog-meta">';
        echo '<img src="img/avatar.png" alt="Avatar" />';
        echo '<tr>'; echo '<td>'; echo '<h4 class="blog-meta-author">'; echo "{$row['created_by']}."; '</h4>';
        echo '<span>'; echo 'Category:'; echo "{$row['catid']}."; echo '</span>'; echo '</td>'; echo '</tr>';
        echo '</table>';
    }

    echo "";

    mysql_close($conn);
?>
  • 写回答

4条回答 默认 最新

  • dongmi5177 2015-09-16 10:25
    关注

    You are Using Old Mysql Syntax Which is deprecated as of PHP 5.5.0, and has been removed as of PHP 7.0.0. If you are using Latest version of PHP then your code will not Work.Change the appropriate Syntax and Try again.

    评论

报告相同问题?

悬赏问题

  • ¥15 目详情-五一模拟赛详情页
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line