Two methods for connecting to MYSQL through PHP are copyrighted: bluemy/php Chinese users reprinted. please contact the author for example to see my articles in the program and code of this website and the following routines: in front-end HTML, you can enter the following table or contact likaSyntaxHighlighter by email. all ();
Two methods for connecting to MYSQL through PHP
Copyright: bluemy/php Chinese users
For more information, contact the author.
The example shows my article in "program and code" on this website and the following routine:
Foreground HTML
You can enter a table in the interval or use the power
Sub-mail contact, likai333@21cn.com.
Your name:
Your email:
The website address you want to advertise:
The website name you want to advertise:
Your Company name:
Your Contact number:
Backend PHP
<? Php
$ Dbh = mysql_connect (localhost: 3306, root ,);
Mysql_select_db (HBWEB );
$ Query = "insert into usemsg (name, usermail, userurl, sitename, company, phone) values ($ name, $ usermail, $ userurl, $ sitename, $ company, $ phone, $ C1, $ C2, $ C3, $ C4, $ C5 )";
$ Res = mysql_query ($ query, $ dbh );
$ Err = mysql_error ();
If ($ err ){
Echo "an error occurred. please notify me ";
Echo "$ err ";
}
Else
{Echo "successful warehouse receiving ";}
? >
Table structure:
Create table usemsg (
Name varchar (255) not null default "notname ",
Usermail varchar (255) not null default "notusermail ",
User URL varchar (255) not null default "notuserurl ",
Sitename varchar (255) not null default "notsitename ",
Company varchar (255) not null default "notcompany ",
Phone varchar (255) not null default "notphone ",
);