我正试图从 mysql
正在使用此模板,但它不起作用,我无法在以下代码中找到错误:
<?php
$connection = mysql_connect("localhost", "root", ""); // Establishing Connection with Server
$db = mysql_select_db("company", $connection); // Selecting Database
//MySQL Query to read data
$query = mysql_query("select * from employee", $connection);
while ($row = mysql_fetch_array($query)) {
echo "<b><a href="readphp.php?id={$row['employee_id']}">{$row['employee_name']}</a></b>";
echo "<br />";
}
?>
我得到以下错误:
Parse error: syntax error, unexpected 'readphp' (T_STRING), expecting ',' or ';'
2条答案
按热度按时间jbose2ul1#
更改href url的“to”。它与开放逗号冲突。
ac1kyiln2#
你必须逃跑
"
当在其他引号内时"
. 更改:echo "<b><a href="readphp.php?id={$row['employee_id']}">{$row['employee_name']}</a></b>";
收件人:echo "<b><a href=\"readphp.php?id={$row['employee_id']}\">{$row['employee_name']}</a></b>";