PHP 中存在解析错误
There is a parse error in PHP
浏览器中显示的错误是:
Parse error: parse error in /Library/WebServer/Documents/portal/page4.php on line 19
<?php
/* Attempt MySQL server connection. Assuming you are running MySQL
server with default setting (user 'root' with no password) */
$link = mysqli_connect("localhost", "root", "password", "demo");
// Check connection
if($link === false){
die("ERROR: Could not connect. " . mysqli_connect_error());
}
$name = $_POST["name"];
// Attempt select query execution
$sql = "SELECT * FROM portal WHERE full_name='$name'";
$result = mysql_query($sql);
echo .$result.;
// Close connection
mysqli_close($link);
?>
改变这个
echo .$result.;
到这个
echo $result;
浏览器中显示的错误是:
Parse error: parse error in /Library/WebServer/Documents/portal/page4.php on line 19
<?php
/* Attempt MySQL server connection. Assuming you are running MySQL
server with default setting (user 'root' with no password) */
$link = mysqli_connect("localhost", "root", "password", "demo");
// Check connection
if($link === false){
die("ERROR: Could not connect. " . mysqli_connect_error());
}
$name = $_POST["name"];
// Attempt select query execution
$sql = "SELECT * FROM portal WHERE full_name='$name'";
$result = mysql_query($sql);
echo .$result.;
// Close connection
mysqli_close($link);
?>
改变这个
echo .$result.;
到这个
echo $result;