在以下代码中,php 返回:
解析错误:语法错误,第 13 行 C:\wamp\www_lab\tablo\test.php 中的意外“{”
但我看不出代码有任何错误。
$conn = mysql_connect("localhost","root","");
mysql_query("SET NAMES UTF8");
$db_select = mysql_select_db("table",$conn);
if (isset($_GET['q'])) {
$q = $_GET['q'];
$raw_results = mysql_query("SELECT * FROM users WHERE (`email` LIKE '%".$q."%') OR (`text` LIKE '%".$q."%')");
if (mysql_num_rows($raw_results) > 0) { // if one or more rows are returned do following
while ( $results = mysql_fetch_array($raw_results) ) {
echo "<p><h3>".$results['name']."</h3>".$results['surname']."</p>";
}
}
}