尝试将 td 类名应用于表中的每个列,以用数据标识它。 目前每个TD都是可内容的,当我添加或更改为TD class="name"时,在页面重新加载时它只是崩溃,为什么?
我什至尝试关闭 php 代码,然后再次打开,但无济于事。
<tbody>
<?php //BEGINNING OF PHP
include("login/dbinfo.inc.php");
$comm=@mysql_connect(localhost,$username,$password);
$rs=@mysql_select_db($database) or die( "Unable to select database");
$sql="SELECT AwbNo, VesselName, ClientCode, Pieces, Weight, Carrier, Sender, Status, DATE_FORMAT(ArrivalDate, '%d-%m-%yyyy') FROM tbl_import";
$result = mysql_query($sql) or die("SELECT Error: ".mysql_error());
$num_rows = mysql_num_rows($result);
echo "<p>There are $num_rows records in the Customer table.</p>";
while ($get_info = mysql_fetch_array($result))
{
echo ("<tr>n");
echo ("<td class="awb">".$get_info["AwbNo"]."</td>");
echo ("<td contenteditable='true'>".$get_info["VesselName"]."</td>");
echo ("<td contenteditable='true'>".$get_info["ClientCode"]."</td>");
echo ("<td contenteditable='true'>".$get_info["Pieces"]."</td>");
echo ("<td contenteditable='true'>".$get_info["Weight"]."</td>");
echo ("<td contenteditable='true'>".$get_info["Carrier"]."</td>");
echo ("<td contenteditable='true'>".$get_info["Sender"]."</td>");
echo ("<td contenteditable='true'>".$get_info["Status"]."</td>");
echo ("<td contenteditable='true'>".$get_info["ArrivalDate"]."</td>");
?>
<td>
<?php
echo '<a href="javascript:edit_user('.$get_info['awb']. ')"> Edit </a>';
echo '<a href="javascript:delete_user('.$get_info['AwbNo']. ')"> Delete </a>'
?>
</td>
<?php
echo ("</tr>n");
}
您需要转义双引号,因此它们不会被读取为 PHP 代码。您可以通过在它们前面键入字符来执行此操作。
" $you_code "