This question already has an answer here:
这个问题在这里已有答案:
- Parse error: syntax error, unexpected 'mysql_query' (T_STRING) in 2 answers
解析错误:语法错误,2个答案中意外的'mysql_query'(T_STRING)
Sorry for asking this question, but I really got stucked with the problem. It seems to me that the code is correct with no syntax errors due to it was copypasted from web and checked in phpmyadmin. But I still have this annoying problem. Give me advice please. Where I am wrong?
很抱歉提出这个问题,但我真的遇到了这个问题。在我看来,代码是正确的,没有语法错误,因为它是从web上复制并在phpmyadmin中检查。但我仍然有这个恼人的问题。请给我建议。哪里错了?
//$sql = "INSERT INTO orders(name, telephone) VALUES('abc', '123')";
$sql = "SELECT * FROM orders WHERE name='abc' AND telephone='123'";
$host = 'localhost';
$username = 'username';
$password = 'password';
$db_name = 'db_name';
mysql_connect( $host, $username, $password, $db_name )
mysql_query($sql);
1 个解决方案
#1
You're missing a ;
here:
你错过了;这里:
mysql_connect( $host, $username, $password, $db_name )
^-- here
#1
You're missing a ;
here:
你错过了;这里:
mysql_connect( $host, $username, $password, $db_name )
^-- here