Yii Learning, yii_php tutorial

Source: Internet
Author: User

Yii Learning, Yii


CONFIG

Tableprefix Setting Table prefixes

MODEL

Set the table associated with the model

Public Function TableName () {

return {{%table_name}} table prefix plus table name format

}

Paging: use yii\data\pagination; $Page = new Pagination ([' totalcount ' = total number of bars, ' pageSize ' = number of pages per page]); Query: Must have a modelmodel name corresponding to the database name:: Find ()->where (condition [' status ' =>1]); $tombList
->offset ($Page->offset pagination)
->limit ($Page->limit number of pages)
->all ();->all (); Query all->one (); Query for a->count (); Number of Queries->average (field); Query average->min (field); Query minimum value->max (field); Query maximum value->scalar (); Query the first row of the first column of the value->column (); Query the value of the first column of all results->each (number); Repeatedly query the result, handle memory overflow phenomenon Delete Yii:: $app->db->createcommand ()->delete (' Table name ', ' condition ')->execute (); Modify Yii:: $app->db- >createcommand ()->update (' Table name ', modify field [' Status ' =>1], ' condition ')->execute (); add Yii:: $app->db-> CreateCommand ()->insert (' table name ', data)->execute ();

http://www.bkjia.com/PHPjc/981701.html www.bkjia.com true http://www.bkjia.com/PHPjc/981701.html techarticle Yii Learning, yii CONFIG tableprefix set table prefix model setting table associated with model public function TableName () {return {%table_name}} table prefix plus table name format} Page: Use yii\ ...

  • 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.