-1
我是新來的PHP,我的代碼保持扔,說錯誤:注意:使用未定義的常量
"Notice: Use of undefined constant client_id first_name last_name assumed 'client_id' 'first_name' 'last_name' in....."
這是我的代碼怎麼看的錯誤。
$DBConnect = @mysqli_connect('localhost', 'root', '', 'client_names');
if($DBConnect === FALSE){
die("Connection failed:" . $DBConnect->connect_error);
}
$DBName = "client_names";
if ([email protected]_select_db($DBConnect, $DBName)){
echo "<p>Cannot open the database!</p>";
}
else{
$TableName ="client_info";
$SQLstring = "Select client_id, first_name, last_name FROM $TableName";
$QueryResult = @mysqli_query($DBConnect, $SQLstring);
if(mysqli_num_rows($QueryResult)==0){
echo "<p>There are no client information!</p>";
}
else {
echo "<p> List of Clients</p>";
echo "<table width='100%'border='1'>";
echo "<tr><th>Client number<tr><th>First Name<tr><th>Last Name";
while($Row = mysqli_fetch_assoc($QueryResult)){
echo "<tr><td>{$Row[client_id]}</td>";
echo "<td>{$Row[first_name]}</td>";
echo "<td>{$Row[last_name]}</td>"</tr>";
這是假設從我的數據庫中提取數據並將其顯示在表上。你能幫忙的話,我會很高興。謝謝。