Add the recorded php code to the database. Php code for adding records to the database this is a simple use of phpmysql to save user submitted information to the database instance. copy the file below to your dw and you will be able to use it. The php code used to add records to the database is a simple php mysql code that saves user submitted information to the database instance. copy the file below to your dw and you will be able to use it.
Add recorded php Tutorial code for database tutorials
This is a simple php mysql tutorial that saves the information submitted by the user to the database instance. copy the file below to your dw and you will be able to use it.
*/
If ($ _ post)
{
$ Host = 'localhost ';
$ User_name = 'root ';
$ Password = 'admin ';
$ Name = $ _ post ['User _ name'];
$ City = $ _ post ['city'];
If (empty ($ name) | trim ($ name) = '')
{
Echo 'Enter 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
Mysql saves the information submitted by the user to the database instance. copy the file below to your dw. Database tutorial...