1. Connection query (join)
A join query refers to a query that associates two or more tables together to obtain data that matches rows from another table. Common connection queries include internal connections (equivalent connections), left (outer)
Queries Builder (query Builder)
1. New data
You can insert one/more data by using the Insert method of the Query Builder:
Db::table (' users ')->insert ([
[' ID ' =>1, ' name ' => ' laravel ', ' email ' => ' laravel@test.com ', ' password ' => '
Laravel is the PHP Web development Framework (PHP Web framework). It frees you from messy code, it helps you build a perfect web app, and every line of code can be concise and expressive. So, how does the Laravel framework operate the database?
1. IntroductionThe database query builder provides a convenient and smooth interface for creating and running database queries. The query builder can be used to perform most database operations in an application and work on all supported database
To get the query Builder simple, or to rely on the db façade, we use the DB Façade table method and pass in the table name to get the table's Query Builder:
$users = db::table (' users ');
So we get to the query builder of the $users table, and in
1. Connection query (join)
A connection query is a query that associates two or more tables together to get data that matches the rows of one table with the rows of another. Common connection queries include inner joins (equivalent connections),
There are two ways to perform database operations in Laravel. one is to use the static method of the \ DB appearance object to directly execute SQL queries, another method is to use the static method of the Model class (in fact, it is also the
Recent small series in learning the world's most bull frame –laravel. In fact, learning framework is the idea of learning the framework! I would like to record in my blog Some of my experience in the Laravel study, Welcome to my other GitHub blog
One, selects retrieve all rows in the table
$users = db::table (' users ')->get ();
foreach ($users as $user)
{
var_dump ($user->name);
}
retrieving a single row from a table
$user = db::table (' users ')->where (' name ', ' John ')->first
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.