PHP connection to MySQL. Help for beginners & lt; html & gt; & lt; head & gt; & nbsp; & lt; title & gt; & lt; title & gt; & nbsp; & lt; meta & nbsp; http-equivContent-Type & nbsp; contenttexthtm PHP link to MySQL. Help
If (@ $ _ POST ["submit"]) {
$ Id = $ _ POST ["id"];
$ Name = $ _ POST ["name"];
$ Age = $ _ POST ["age"];
$ Tel = $ _ POST ["tel"];
$ Address = $ _ POST ["address"];
$ Conn = @ mysql_connect ("localhost", "root", "ROOT") or die ("database connection times out. please try again later! ");
Mysql_select_db ("test", $ conn );
Mysql_query ("set names 'utf8 '");
$ SQL = "select * from 'student '";
$ SQL = "INSERT INTO 'student '('id', 'name', 'age', 'Tel', 'address') VALUES ('$ ID ', '$ name',' $ age', '$ tel', '$ address ')";
Mysql_query ($ SQL );
}
?>
This is the data table I created. it is null to add data generation and refresh the data table on the page. What is the problem?
------ Solution --------------------
The entered text encoding is inconsistent with the database encoding.
------ Solution --------------------
Mysql_query ($ SQL) or die (mysql_error () to see what the error is?