PHP operation memcached Cache for the implementation code of the data, phpmemcached_php tutorial

Source: Internet
Author: User
Tags image processing library

PHP operation memcached Cache for the implementation of the code to increase and remove data, phpmemcached


Core code:

<?php//Create a Memcache object instance $memcache = new Memcache;if (! $memcache->connect ("127.0.0.1", 11211)) {die (' connection failed ');} if ($memcache->set (' Key1 ', "Xian", memcache_compressed,60)) {echo ' sucess! ';} The stored value, where the Xian string, can also be an array, an object, but not a resource $val = $memcache->get (' key1 ');//query Gets the value echo $val; $memcache->replace (' Key1 ', ' Beijing ', memcache_compressed,60);//Modify   $memcache->delete (' key1 ');//Delete?>

How to use Php+mysql to achieve the Web page additions and deletions can be changed? Just talk about the exact process.

Ho, this is not a small background operation.
Give a thought: make a table, use a foreach loop to print out the table information, and present in the table table, in the form of the last two TD to write the edit, delete, as for the increase to single open the page, edit the ID to pass the past, Remove all values of the ID at once and pay the value to be relevant, delete is simpler, delete the row data from the table based on the passed ID.
As for uploading images, you want to encapsulate the image processing library, simply pass the name of the image, through the $_files global variables related operations, such as the evaluation of the upload file suffix, size and upload failed to present to the customer information.

PHP Package A class can be implemented MySQL database additions and deletions to search

Look at the mess Ah!

http://www.bkjia.com/PHPjc/864475.html www.bkjia.com true http://www.bkjia.com/PHPjc/864475.html techarticle PHP operation memcached Cache for the implementation of the data phpmemcached Code, Core code: php//Create a Memcache object instance $memcache = new Memcache;if (!$ Memcache-connec ...

  • Contact Us

    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

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.