I'm a little speechless. It's such a simple statement, but I searched for a long time and couldn't find out why the data couldn't be inserted.
There is no problem with the local database. It should be a code problem, but I am blinded and cannot find the error. Please help me.
小伙看你根骨奇佳,潛力無限,來學(xué)PHP伐。
Finally I found the correct answer. declare is a system reserved keyword, so this database table cannot be used. . . After all, he is too young. . .
Your MySQL port seems to be 3305, but you did not specify it. The default port is 3306.
First of all, it is not recommended to use MySQL extension, it is unsafe, and PHP has been abandoned. Use MySQLi or PDO.
Secondly. If the execution fails, use mysql_error()
to obtain the error information.