Use sync Notes for Notes to blog to test! Knowledge point is a bit miscellaneous, to organize (local debugging) to establish a site:
1: Establish the domain name IP correspondence in the Hosts file (C:\WINDOWS\SYSTEM32\DRIVERS\ETC):
127.0.0.1 www.****.com//2: Create a new site in the Apache configuration file:--site path cannot have Chinese
<virtualhost *:80>
ServerName www.****.com
DocumentRoot "Project Absolute path"
<directory "Project Absolute path" >
Options Indexes
Order Deny,allow
Allow from all
</Directory>
</VirtualHost>//3: Restart Wamp all services. To connect to a database prerequisite action:
//(1). Connect to Server
(2). Set a unified receive encoding
(3). Select the database where the data is storedThe above code can be integrated into one sentence://$con = Mysqli_connect ("servername", "username", "password") or Die (' connection server failed, failure reason: '. mysqli_connect_ Error ()); $con = Mysqli_connect ("servername (usually localhost)", "username", "password");
if ($con)
{
Echo ' Connect server successfully ';
echo "<br/>";
}
Else
{
Die (' connection server failed, reason for failure: '. Mysqli_connect_erro ());
}
Mysqli_query ($con, "Set names ' UTF8 '");
Similarly, the following code can be integrated into one sentence://$result = mysqli_select_db ($con, "tablename") or Die (' Select Table Failed '. Mysql_error ()); $result = mysqli_select_db ($con, "Bloge");
if ($result)
{
Echo ' Select Database Success ';
}
Else
{
echo ' Select table failed, failure reason: '. mysql_error ();
If you have not yet created a database and built a table:
To create a database:
Create database name CharSet UTF8;
To create a table:
CREATE TABLE Liuyanbiao (
ID int primary KEY auto_increment,
xingming varchar () NOT NULL,
Biaoti varchar (+) NOT NULL,
Fabushijian datetime NOT NULL,
Neirong varchar (1000),
Huifu varchar (1000)
) charset UTF8;)
From for notes (Wiz)
MySQL basic knowledge