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);
?>

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.

Please note mysql_fetch_array only need data(array), no need to give MYSQL_ASSOC, Cz your conflicting MySQL and MySQLi

and

Warning This extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. Instead, the MySQLi or PDO_MySQL extension should be used.

change this

while($row = mysql_fetch_array($retval, MYSQL_ASSOC))

to this

while($row = mysql_fetch_array($retval))

and inside while just use

echo  $row['created'];

No need of use like this echo "{$row['created']}.";

Try remove the first line table and put inside

example

while($row = mysql_fetch_array($retval))
    {
     echo '<table>';

I have tried to run your code with only adjusted connection credentials and table/column names and it works fine (using php 5.5 and php 5.3).

Isn't possible there is no record in the database? Another possibility could be some typo.

Edit: Also you have only one table opening tag while as many closing tags as there is records present. Try to inspect source code of the 'blank page'.

Edit2: Try running this snippet instead of your former code and let us know what happens:

<?php
    // connection string constants
    define('DSN', 'mysql:dbname=muslimtimes360;host=localhost');
    define('USER', 'myusernm');
    define('PASSWORD', 'mypwd');

    // pdo instance creation
    $pdo = new PDO(DSN, USER, PASSWORD);

    // query preparation
    $stmt = $pdo->query("
        SELECT title, introtext, created, created_by, catid
        FROM mydb_items
    ");

    // fetching results
    $result = $stmt->fetchAll(PDO::FETCH_ASSOC);

    // if this returns 0 then it means no records are present
    echo count($result) . "
";

    // the loop should print valid table
    foreach ($result as $index => $row) {
        if ($index == 0) echo '<table>';
        echo <<<HTM
<tr>
    <td>
        <span class="post-date">{$row['created']}</span>
    </td>
</tr>
<tr>
    <td>
        <h2 class="blog-post-title">{$row['title']}</h2>
    </td>
</tr>
<tr>
    <td>
        <p>
            {$row['introtext']}
        </p>
    </td>
</tr>

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