Database add a record of PHP code this is a simple use of PHP MySQL to save the user submitted information to the database instance Oh, copy the file below to your DW can be used OH.
Database tutorial Add a documented PHP tutorial code
This is a simple use of PHP MySQL tutorial to save the user submitted information to the database instance Oh, copy the file below to your DW can be used OH.
*/
if ($_post)
{
$host = ' localhost ';
$user _name = ' root ';
$password = ' admin ';
$name = $_post[' user_name ');
$city = $_post[' city ');
if (Empty ($name) | | trim ($name) = = ")
{
Echo ' Please fill in the user name! Return ';
Exit
}
$conn = mysql_connect ($host, $user _name, $password);
if (! $conn)
{
Die (' Database connection failed: '. mysql_error ());
}
mysql_select_db (' Test ');
$sql = "INSERT into users set Id=7,name= '". $name. "', city= '". $city. "', Created_time=now ()";
mysql_query ($sql) or Die ("
Error:
". Mysql_error ()."
sql: ". $sql);
Mysql_close ($conn);
Echo ' data inserted successfully, open view data ';
}
?>
Submit User Information
http://www.bkjia.com/PHPjc/630824.html www.bkjia.com true http://www.bkjia.com/PHPjc/630824.html techarticle database Add a record of PHP code this is a simple use of PHP MySQL to save the user submitted information to the database instance Oh, copy the file below to your DW can be used OH. The database teaches ...