If you continue browsing the site, you agree to the use of cookies on this website. But my code is not in the xampphtdocs directory many people dont put their code there. In this programming with yii2 series, im guiding readers in use of the yii2 framework for php. It is the foundation for other more advanced database access methods, including query builder and active record.
The sql statement to be executed may be set via text. Aug 29, 2016 yii2 slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. Dengan kemampuan yang sedikit di php maka anda tidak bisa maksimal dalam membangun sebuah aplikasi. The query builder provides an objectoriented vehicle for generating queries to be executed. Im using yii cdbcommand to fetch result from mysql. The former is the preferred way as it allows you to install new extensions or update yii by running a single command.
Apr 05, 2020 read only yii 2 framework core code only. Create your free github account today to subscribe to this repository for new releases and build software alongside 40 million developers. The issue allows an attacker to potentially execute arbitrary php script on the server. Cdbcommand represents an sql statement to execute against a database. In this video i will show how you can use sql query in yii 2. Jan 06, 2015 in this video i will show how you can use sql query in yii 2. You can find more information about this tutorial at. Php query builder query builder allows you to create sql queries in a programmatic way. The naming scheme now follows the directory structure. Yii2 application development cookbook third edition. Im new to yii framework and your website has been useful to me, thank you very much, i would like to ask you some quiz whenever i seem to stack if you dont mind. Select query for model this tutorial will help you to get the list of function to retrieve or select the data from the database using model of yii2.
First you should create activerecord class for video and likes tables to make things easier. A typical usage of the query builder looks like the following. You can also use the vishare script to learn yii framework. Yii framework 2 basic training manop kongoon yii2 yii framework yii framework 2. Yii is a highperformance programming framework for developing web applications in php 5. In this tutorial, we are going to show you how to download database table data in excel file using yii excel export extenstion.
This release fixes a security issue found in cdetailview in the 1. Easily update your skills from the previous version of the framework. Yii framework 2 basic training linkedin slideshare. I recently migrated couple of moderately complex applications from yii 1.
It enables maximum reusability in web programming and can significantly accelerate the development process. Oct 22, 2015 learning yii 2 demonstrates how it is entirely possible to write quality applications fast. Mine is in another directory and my apache config file is taking care of that. Query builder helps you write more readable sqlrelated code. But the result is not the same as of running the same sql in phpmyadmin. Write your applications more efficiently using shortcuts, yiis core functionality, and the best practices in web 2. The columns in the new table should be specified as namedefinition pairs e. While useful in some situations, it can be tedious and errorprone to write raw sqls. May 24, 2015 yii framework 2 basic training manop kongoon 3 yii framework 2 11 12. Built on top of pdo, yii dao database access objects provides an objectoriented api for accessing relational databases. Then migrate part by part, while it is possible it was quite bit of pain, like trying to rebuild the second floor while living on the third. All this with minimal effort on your part, because the yii framework simplifies the overhead work. Yii createcommand queryall i posted here examples of createcommand query with properties.
Yii framework 1 yii is a highperformance php framework best for developing web applications. When using yii dao, you mainly need to deal with plain sqls and. The aim is to create the two following classes class video extends \ yii \db\activerecord and class likes extends \ yii \db\activerecord. This course will show you how to create a basic but fully functional dating site for monsters. Below you will find the download packages including the html files of guide and api documentation as well as links to the pdf versions of the guide in different languages. I updated most of the functions it will helpful for yii2. Basically you install the extension and start using it like you do with all normal yii 2 application components but with a shorter simpler syntax, lets take a look in case you wonder, all default facades, including an abstract base facade reside under a sergeymakinen\facades namespace.
1320 674 164 1273 852 1426 1224 1183 1484 781 897 616 1237 1286 1189 920 1357 68 1249 1122 508 1142 8 933 1482 1151 197 563 853 889 1345 1082 1406 251