Make a paging display
Database Tutorial Connections
The code is as follows
Copy Code
?$conn =mysql Tutorial _connect ("127.0.0.1", "", "");mysql_select_db ("Shop");?>
The key is to use the limit in the SQL
$CN = MySQL tutorial _connect (' localhost ', ' root ', ');mysql_select_db (' Test ', $CN);Creating a Databasemysql_query ("Create datebase ' test ';");Creating data Tables$sql = "CREATE TABLE IF not EXISTS ' test ' (' ID ' int (8) not NULL
First step
/*First create the data table directly copy to your phpMyAdmin directly run on OK. 1
CREATE TABLE IF not EXISTS ' useradmin ' (' ID ' int (4) not NULL auto_increment,' username ' varchar default NULL,' userpass ' varchar default NULL,'
PHP Cookie InstanceHere is a PHP cookie to set the user login time and expiration time code OH
function Logincookie ($uid, $name, $group, $ip, $time){Global $site _domain, $login _key;$domain = (substr ($site _domain,0,4) = = "www.")? substr ($site
Refer to the online articles. As the saying goes, you will not copy a large copy of the article. The key is to use it for me. This is the most important thing. Let's go.In fact, sending mail is very simple. php has ready-made functions. You can
The code is as follows:Copy code Function NumToStr ($ num ){If (stripos ($ num, 'E') == false) return $ num;$ Num = trim (preg_replace ('/[= \' "]/','', $ num, 1),' "'); // Scientific notation is displayed, returns a string.$ Result = "";While ($
1. Add elements to a one-dimensional array$ ArrayList = ArrayListay ();Array_push ($ ArrayList, el1, el2... eln );But there is actually a more direct and convenient way: The code is as follows:Copy code $ ArrayList = ArrayListay ();$ ArrayList []
Example The code is as follows:Copy code Session_start ();If (empty ($ _ SESSION ['IP']) // The first write operation to determine whether the ip address is recorded and whether to write data to the database{$ _ SESSION ['IP'] = $ _ SERVER
Knowledge points to be learned in the early stageMove_uploaded_file () file upload function The code is as follows:Copy code If (move_uploaded_file ($ _ FILES ["filename"] ["tmp_name"]){Echo 'file uploaded successfully ';} $ _ FILES php global
Let's first look at the Directory Traversal The code is as follows:Copy code Function tree ($ directory){ $ Mydir = dir ($ directory );Echo " n ";While ($ file = $ mydir-> read ()) { If (is_dir ("$ directory/$ file") AND ($ file! = ".") AND ($
Example 1 The code is as follows:Copy code /*** Change the color of every row and column* String fun_table (int $ rows = 9, int $ cols = 9)* $ Rows indicates that the number of rows must be an integer and must be between 1 and 20* $ Cols
Because I log on several times and the connection speed is very slow, I gave up. Of course, there are too many message plug-ins. For example, it's a bit of a hot talk now, but it's still a problem for friends who haven't registered many words. For
1. First install memcached or memcache softwareSee wamp for detailed instructions on installing memcache/memcached.2. Install php_memcache.dll extension3. Set the session to be saved in memcachedMethod 1:Modify the php. Ini file The code is as
How to implement the Infinitus topic classification idea: get the auto-increment ID (that is, the parent ID) and then obtain the sub-ID (that is, the uid sub-id) data in the database as follows:Id: 1 uid: 0 I'm column 1Id: 2 uid: 1 I'm column 2Id: 3
In this way, after one access, no advertisement will be called. In this way, it's amazing. No advertisement will be skipped. Second, it can increase revenue.The code is as follows: The code is as follows:Copy code Session_start ();$ LifeTime = 2
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service