Bad Wolf php learning counter instance code. Create a file as follows, connect to the database in step 1st, write the file, and read the. copy the code as follows :! The DOCTYPEhtmlPUBLIC-W3CDTDXHTML1.0TransitionalENwww.w3.orgTRxhtml1D then creates the file as follows, step 1st connects to the database, then writes, and then reads.
The code is as follows:
$ Mysql_server_name = "localhost ";
$ Mysql_username = "root ";
$ Mysql_password = "";
$ Mysql_database = "db ";
// Capture ip addresses
$ Ip = getenv ("REMOTE_ADDR ");
// Establish a line-through (servo server location, user name, user password)
$ Conn = mysql_connect ($ mysql_server_name, $ mysql_username, $ mysql_password );
// Prepare SQL syntax. this syntax is newly added.
$ SQL = "INSERT INTO 'num' ('name', 'IP', 'new') VALUES ('badwolf ',' $ IP', '1 ');";
// Select the database you want to process
Mysql_select_db ($ mysql_database, $ conn );
// Query
$ Result = mysql_query ($ SQL );
// Result and release the link
Mysql_close ($ conn );
//------------------------------------------------------------------
// Print the following information
// Establish the connection (servo server location, user name, user password)
$ Conn = mysql_connect ($ mysql_server_name, $ mysql_username, $ mysql_password );
// Prepare SQL syntax. this syntax is used to read data.
$ SQL = "SELECT COUNT (*) FROM 'num' WHERE name = 'badwolf '";
// Query
$ Result = mysql_db_query ($ mysql_database, $ SQL, $ conn );
// Capture the query results
$ Row = mysql_fetch_row ($ result );
// Print all columns of the data
// Print_r ($ row );
// Clear the query results
Mysql_free_result ($ result );
?>
Bad Wolf safety net php counter
Bad Wolf safety net php counter
So far Times
Pipeline. the code is as follows :! DOCTYPEhtmlPUBLIC "-// W3C // DTDXHTML1.0Transitional //" http://www.w3.org/TR/xhtml1/D...