In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
This article is to share with you the contents of phpcms add, delete and change the use of the query statement. Xiao Bian thinks it is quite practical, so share it for everyone to make a reference. Let's follow the editor and have a look.
I. Check
1、select($where = '', $data = '*', $limit = '', $order = '', $group = '', $key='')
/** * execute SQL queries * @param $where Query criteria [e.g.`name`='$name'] * @param $data Field value to query [example `name`,`gender`,`birthday`] * @param $limit Return result range [example: 10 or 10, 10 is empty by default] * @param $order sort by [Default Sorted by Database Default] * @param $group cluster approach [Default is empty] * @param $key Return array key name sort * @return array Query Result Set Array */
2、listinfo($where = '', $order = '', $page = 1, $pagesize = 20, $key='', $setpages = 10,$urlrule = '',$array = array(), $data = '*')
/** * Query multiple pieces of data and paginate * @param $where * @param $order * @param $page * @param $pagesize * @return unknown_type */
3、get_one($where = '', $data = '*', $order = '', $group = '')
/** * Get Single Record Query * @param $where query criteria * @param $data Field value to query [example `name`,`gender`,`birthday`] * @param $order sort by [Default Sorted by Database Default] * @param $group cluster approach [Default is empty] * @return array/null Data query result set, if it does not exist, return null */
4、query($sql)
/** * Execute sql query directly * @param $sql query SQL statement * @return boolean/query resource If query statement, return resource handle, otherwise return true/false */
II. Increase
1、insert($data, $return_insert_id = false, $replace = false)
/** * Perform add record operation * @param $data To add data, the argument is an array. Array key is field value, array value is data value * @param $return_insert_id Return new ID number * @param $replace Add data by replacing into * @return boolean */
2、insert_id()
/** * Gets the primary key number of the last record added * @return int */
III. Changes
3、update($data, $where = '')
/** * Perform an update record operation * @param $data To update the data content, parameters can be array or string, it is recommended array. * Array key is field value, array value is data value * If it is a string [e.g.`name`='phpcms',`hits`=`hits`+1]. * array [example: array ('name '=>' phpcms','password'=>'123456')] * An alternative to arrays is array ('name '=>'+= 1','base'=>'-= 1'); the program automatically resolves to `name` = `name` + 1, `base` = `base` - 1 * @param $where Conditions for updating data, which can be arrays or strings * @return boolean */
IV. Deletion
1、delete($where)
/** * Perform delete record operation * @param $where Delete data condition, not allowed to be empty. * @return boolean * Thank you for reading! About phpcms add delete change the use of the sentence to share here, I hope the above content can be of some help to everyone, so that we can learn more knowledge. If you think the article is good, you can share it so that more people can see it!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.