September 20, 2017
May 3, 2017
Database: Select Query: Laravel simple select query with example
On Laravel, you may not always want to select all columns from a database table.
- Here I try to explain with simple example:
Example:
$users = DB::table(<tablename>)->select('field1', 'field2')->get();
- If you want to used and alias for any field name then just used - as
$users = DB::table(<tablename>)->select('field1', 'field2 as newname')->get();
- Used 'Distinct' with Laravel select query
$users = DB::table(<tablename>)->distinct()->get();
- Sometime if you want to used other expression with SQL query
$users = DB::table(<tablename>)->select(DB::raw('count(*) as cnt, field1
->where('field1', '>', 1)
->groupBy('field1')
->get();
Enjoy!
April 26, 2017
How to start development on Laravel?
I start to learn and developer on Laravel.
Laravel 5.4 is latest version.
Introdiction:
This quickstart guide provides a basic introduction to the Laravel framework and includes content on database migrations Blade templates. This is a great starting point if you are brand new to the Laravel framework or PHP frameworks in general.
For installation you need Composer and below is command for that:
- composer create-project laravel/laravel quickstart --prefer-dist
You are free to quick start and download into your local machine.
You just need to write below command for easy download
git clone https://github.com/laravel/quickstart-basic quickstart
cd quickstart
composer install
php artisan migrate
If you have any of suggestion then please share it on comment please.
Enjoy!
April 11, 2017
How to get table all field's value in single word/query?
- If you want to get table all field's value in single and simple SQL query then you need to write some simple word.
- Use this simple query
Example:
SELECT * FROM <tablename>
Enjoy!
Subscribe to:
Posts (Atom)
1980s Photo Prompts: Easy Online Copy & Paste
Are you on a quest to enhance your photography projects with a touch of nostalgic flair? Look no further than 1980s photo prompts. These car...
-
Put this code between <head>...</head> tag. <script type="text/javascript"> function readURL(input) { ...
-
Yes, normally datatable Ajax file call outside of AngularJs folder structure, If you define ng-click there then it’s not working in An...
-
Using PHP to upload files into MySQL database sometimes needed by some web application. For instance for storing pdf documents or images to ...



