Php-mysql回车返回


php-mysql carriage returns

我对php/mysql比较陌生。我正试图为这部分做回车:

echo "<td colspan='5'>" . nl2br($row['dish_description']) . "</td>";

"dish_description"包含一些包含"'n"的文本如。配上沙拉和薄荷酱。'n含有牛肉。"在MySQL数据库中但是我不能显示回车

    <?php
    require_once 'login.php';
    $con = mysql_connect($db_hostname, $db_username, $db_password);
    mysql_select_db($db_database) or die("Unable to select database". mysql_error());
    $result = mysql_query("SELECT * FROM `dishes` ORDER BY `dishes`.`dish_id` ASC LIMIT 0 , 200");
    echo '<table align="center">
    ';
    while($row = mysql_fetch_array($result))
    {
    echo "<tr>";
    echo "<td style='width: 60px'></td>";
    echo "<th style='width: 100px'>Dish No</th>";
    echo "<td style='width: 70px'>" . $row['dish_id'] . "</td>";
    echo "<th style='width: 100px'>Dish Name</th>";
    echo "<td style='width: 120px'>" . $row['dish_name'] . "</td>";
    echo "<th style='width: 120px'>Dish Price</th>";
    echo "<td>£" . $row['dish_price'] . "</td>";
echo "</tr>";
echo "<tr>";
    echo "<td style='width: 75px'></td>";
    echo "<th style='width: 100px'>Vegetarian</th>";
    echo "<td style='width: 70px'>" . $row['dish_vegetarian']   ."</td>";
    echo "<td style='width: 100px'></td>";
    echo "<td style='width: 70px'></td>";
    echo "<th style='width: 120px'>Contains Nuts</th>";
    echo "<td style='width: 120px'>" . $row['dish_nuts']   ."</td>";
echo "</tr>";
echo "<tr>";
    echo "<td style='width: 75px'></td>";
    echo "<th style='width: 100px'>Information</th>";
    ***echo "<td colspan='5'>" . nl2br($row['dish_description']) . "</td>";***
echo "</tr>";
echo "<tr height='10px'>";
    echo "<td style='width: 75px'></td>";
    echo "<td style='width: 100px'></td>";
echo "</tr>";
    }
    echo "</table>";
    mysql_close($con);
?>

在我看来,如果你把echo作为HTML,你可以在数据库中添加<br>标签。