<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Joydeep M, Author at scmGalaxy</title>
	<atom:link href="https://www.scmgalaxy.com/tutorials/author/joydeep/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.scmgalaxy.com/tutorials/author/joydeep/</link>
	<description>A Platform for Software Engineers</description>
	<lastBuildDate>Mon, 12 Jul 2021 09:27:38 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1</generator>
	<item>
		<title>Laravel 5.8 CRUD operation with example</title>
		<link>https://www.scmgalaxy.com/tutorials/laravel-5-8-crud-operation-with-example/</link>
					<comments>https://www.scmgalaxy.com/tutorials/laravel-5-8-crud-operation-with-example/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Thu, 22 Apr 2021 10:40:24 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[crud]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=5946</guid>

					<description><![CDATA[<p>In this tutorial we will learn how we can create a project in CRUD (Create, Read, Update and Delete) operations [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/laravel-5-8-crud-operation-with-example/">Laravel 5.8 CRUD operation with example</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In this tutorial we will learn how we can create a project in CRUD (Create, Read, Update and Delete) operations through Laravel. We will get to know how to create, update read and delete in Laravel from Scratch.</p>



<p class="wp-block-paragraph">Initially have to download Laravel 5.8 version. For this you have to go to command prompt, in which first we have go to our folder path in which we want to download Laravel 5.8. After this we have to run &#8220;composer&#8221; command, because all Laravel depository is handled by composer. After run &#8220;composer&#8221; command we have to run following command:</p>



<pre class="wp-block-code"><code>composer create-project laravel/laravel=5.8 crud --prefer-dist</code></pre>



<p class="wp-block-paragraph">After downloading Laravel 5.8, we have to make Mysql database connection from Laravel 5.8.</p>



<p class="wp-block-paragraph">We have to find <strong>.env</strong> file in your Laravel 5.8 folder. Open that file and under we have to define our mysql database before that we have to create a database in our mysql named as &#8216;crud&#8217; and then we have to configure our .env as given below.</p>



<pre class="wp-block-code"><code>DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=crud
DB_USERNAME=root
DB_PASSWORD=</code></pre>



<p class="wp-block-paragraph">After this we have to create migration file in our Laravel folder. For this we have to write following command in your command prompt.</p>



<pre class="wp-block-code"><code>php artisan make:migration create_crud_table --create=crud</code></pre>



<p class="wp-block-paragraph">This command will create migration file in <strong>database/migrations</strong> folder. In this file we have to define table column which we want to create in table. Below we can find migration file in which we have define table column.</p>



<script src="https://gist.github.com/Joydeep-cotocus/ad5e12b87eae012268f2f8e012964010.js"></script>



<p class="wp-block-paragraph">Now we want to migrate this table definition from this Laravel application to mysql database. For this we have write following command in command prompt. This command will make crud table in mysql database for perform CRUD operation from Laravel 5.8 application.</p>



<pre class="wp-block-code"><code>php artisan migrate</code></pre>



<p class="wp-block-paragraph">Now we have to create model for our database which is used for operations in controller class. To create a model we will run the command given below.</p>



<pre class="wp-block-code"><code>php artisan make:model Crud -m</code></pre>



<p class="wp-block-paragraph">This command will make <strong>Crud.php</strong> model file in <strong>app</strong> folder. In this file we have to define table column name which we can see below source code of <strong>Crud.php</strong> file.</p>



<script src="https://gist.github.com/Joydeep-cotocus/c63d2ae41561fd2a4d1c8600488176ac.js"></script>



<p class="wp-block-paragraph">Now we have to create Laravel 5.8 crud controller. For this we have to go to command prompt and under this we have write following command.</p>



<pre class="wp-block-code"><code>php artisan make:controller CrudsController --resource</code></pre>



<p class="wp-block-paragraph">This command will make <strong>CrudsController.php</strong> file in <strong>app/Http/Controllers</strong> folder. Once we open this file, we can find all predefine method for do CRUD operation in this controller file. We have to just add code for doing particular operation. Below we can find CRUD controller file code.</p>



<script src="https://gist.github.com/Joydeep-cotocus/258c028f8542366e7033dfb255de2942.js"></script>



<p class="wp-block-paragraph">Now we have to set route of all CrudsController class method. For this we have to open to <strong>routes/web.php</strong> file. In this file we have to write following code for set route of all method.</p>



<pre class="wp-block-code"><code>Route::resource('crud','CrudsController');</code></pre>



<p class="wp-block-paragraph">Now in this step we have to set data in view file which has been store under <strong>resources/views</strong> folder, because this view file has received data from controller method, so here we have to set data in view file. Below we can find all view file which has been used in Crud application, and we can also find how data has been set and how to make form in Laravel 5.8 view file.</p>



<script src="https://gist.github.com/Joydeep-cotocus/79ca56789743fb0015a265e02e4354be.js"></script>



<script src="https://gist.github.com/Joydeep-cotocus/910a09d56d35b0dd66e8370c174ee7c6.js"></script>



<script src="https://gist.github.com/Joydeep-cotocus/e1db80b1febd9aa341cc74a8588c442b.js"></script>



<script src="https://gist.github.com/Joydeep-cotocus/9d83e06f63e2bc7a61a52b811b58cf90.js"></script>



<script src="https://gist.github.com/Joydeep-cotocus/81b3c52ba18174c8962b986f4c5465af.js"></script>



<p class="wp-block-paragraph">Now we can run the Laravel 5.8 Crud application, for this we have to go to command prompt, and write following command.</p>



<pre class="wp-block-code"><code>php artisan serve</code></pre>



<p class="wp-block-paragraph">For reference you can see the video given below:</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe  id="_ytid_42598"  width="640" height="360"  data-origwidth="640" data-origheight="360" src="https://www.youtube.com/embed/3Dt34Tb2QIA?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;" class="__youtube_prefs__  epyt-is-override  no-lazyload" title="YouTube player"  allow="fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen data-no-lazy="1" data-skipgform_ajax_framebjll=""></iframe>
</div></figure>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/laravel-5-8-crud-operation-with-example/">Laravel 5.8 CRUD operation with example</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/laravel-5-8-crud-operation-with-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Create Multiple Role Based Authentication in Laravel 5.8</title>
		<link>https://www.scmgalaxy.com/tutorials/how-to-create-multiple-role-based-authentication-in-laravel-5-8/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-to-create-multiple-role-based-authentication-in-laravel-5-8/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Fri, 16 Apr 2021 07:22:26 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[laravel]]></category>
		<category><![CDATA[laravel project]]></category>
		<category><![CDATA[Login]]></category>
		<category><![CDATA[logout]]></category>
		<category><![CDATA[multi authentication]]></category>
		<guid isPermaLink="false">https://www.scmgalaxy.com/tutorials/?p=5893</guid>

					<description><![CDATA[<p>In this tutorial we will see how we can create a basic multiple role based authentication page by using Laravel. [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-create-multiple-role-based-authentication-in-laravel-5-8/">How to Create Multiple Role Based Authentication in Laravel 5.8</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In this tutorial we will see how we can create a basic multiple role based authentication page by using Laravel. To understand it we should have more than basic understandings of Laravel.</p>



<ul class="wp-block-list"><li>To start it as we all know we have to create a project (xampp/htdocs directory) in our terminal by running the command given below:</li></ul>



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color">composer create-project --prefer-dist laravel/laravel multi-auth "5.8.*"</span></code></pre>



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color">cd multi-auth</span></code></pre>



<ul class="wp-block-list"><li>Once we have created the project we will run the make:auth command to create the default login authentication system of laravel.</li></ul>



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color">php artisan make:auth</span></code></pre>



<ul class="wp-block-list"><li>Now we need to customize the users_table under migration as per our requirement.</li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/5c679518c74fda9d6c42f325145aa6c5.js"></script>



<ul class="wp-block-list"><li>Now we have to create model and migration for role table where we can see the different roles who can login like &#8216;admin&#8217;, &#8216;user&#8217; etc.</li></ul>



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color">php artisan make:model Role -m
</span></code></pre>



<ul class="wp-block-list"><li>In the roles table we will customize the Schemas as per the requirement.</li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/840aaae005b136e252fd7aa715433d83.js"></script>



<ul class="wp-block-list"><li>So now we have two model naming Users and Roles and both are dependent on each other hence we need to make a relationship between them.</li><li>To create a relationship we will create functions in both the model for the other one by giving the command given below.</li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/33ec12e64aaff627178188a7db5fe3c2.js"></script>



<script src="https://gist.github.com/Joydeep-cotocus/5aa63d070c5f06e585eff7146eb48fe8.js"></script>



<ul class="wp-block-list"><li>In the next step we need to create seeders for each of the model (User , Role). To create the UsersTableseeder and</li></ul>



<p class="wp-block-paragraph">RolesTableSeeder we will run the command given below.</p>



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color">php artisan make:seed UsersTableSeeder
php artisan make:seed RolesTableSeeder</span></code></pre>



<ul class="wp-block-list"><li>After the following step we need to add<strong> insert</strong> function in the <strong>UsersTableseeder</strong> and <strong>RolesTableSeeder</strong> and also declare the<strong> use Illuminate\Support\Facades\DB;</strong> in both the seeders in the beginning since we will be using DB class in the seeders.</li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/9b4ae503abedb52bffbd0d0d3f50f1f4.js"></script>



<script src="https://gist.github.com/Joydeep-cotocus/a39049e4507a74a9e1af5086278ea1c9.js"></script>



<ul class="wp-block-list"><li>Once we are done with the steps given above we will create a database and link it with the project in the .env file. In this project I have named the database as <strong>corona </strong>(since it is in trend <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f61b.png" alt="😛" class="wp-smiley" style="height: 1em; max-height: 1em;" />) and added that in my .env file as shown below, with that we will keep the username as <strong>root</strong> and leave the password blank.</li></ul>



<figure class="wp-block-image size-large"><img fetchpriority="high" decoding="async" width="1024" height="604" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/04/env-1024x604.jpg" alt="" class="wp-image-5894" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/04/env-1024x604.jpg 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/04/env-300x177.jpg 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/04/env-768x453.jpg 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/04/env.jpg 1201w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<ul class="wp-block-list"><li>Once done with the database creation we will migrate our tables into the database with the command given below.</li></ul>



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color">php artisan migrate</span></code></pre>



<ul class="wp-block-list"><li>In the next step we need to define two created seeders files (UsersTableSeeder and RolesTableSeeder) into the DatabaseSeeder.php as shown below:</li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/04883a7777df6cdd2b184a82e7b0788c.js"></script>



<ul class="wp-block-list"><li>Now we need to import our data stored in the Seeder files into the database which we created using the command:</li></ul>



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color">php artisan db:seed</span></code></pre>



<ul class="wp-block-list"><li>Until here we have set up the database for storing the details which will be provided by the user and now we need to create the controllers and the middleware to authenticate and redirect the users to there respective pages.</li><li>First of all we need to create controller for User and the Admin.</li><li>To create the controller we need to the follow the command given below:</li></ul>



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color">php artisan make:controller Admin/AdminController</span>
<span class="has-inline-color has-vivid-red-color">php artisan make:controller User/UserController</span></code></pre>



<ul class="wp-block-list"><li>Now we will be creating middleware for the authentication of the Admin and the User.</li></ul>



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color">php artisan make:middleware AdminMiddleware
php artisan make:middleware UserMiddleware</span>
</code></pre>



<ul class="wp-block-list"><li>Now we will add Auth trait in the AdminMiddleware and UserMiddleware for authentication of the User and the Admin by writing <strong>use Auth;</strong></li><li>In the next step we will add <strong>handle() </strong>function in the AdminMiddleware and UserMiddleware.</li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/7725e51cf1bdd0dcaf413969a858f312.js"></script>



<script src="https://gist.github.com/Joydeep-cotocus/d6bf8d1a3b0aad0ab11530d0c1eed33f.js"></script>



<ul class="wp-block-list"><li>We will also implement Condition for <strong>Admin </strong>and <strong>User</strong> Login in <strong>RedirectIfAuthenticated </strong>which is in <strong>app/Http/Middleware/RedirectIfAuthenticated.php</strong>.</li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/7b9d1f429963d00a585f382596d8dc70.js"></script>



<ul class="wp-block-list"><li>Now we will be implementing condition in the login controller before that we will remove <strong>‘/home’</strong>&nbsp;from protected&nbsp;<strong>$redirectTo = ‘/home’;</strong> since we don&#8217;t want to redirect the page to <strong>Home</strong> after logging in.</li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/17bb714a11deae02aa4965c7a6784023.js"></script>



<ul class="wp-block-list"><li>Likewise we will implement condition in the <strong>ResetPasswordController </strong>and remove <strong>‘/home’</strong>&nbsp;from protected&nbsp;<strong>$redirectTo = ‘/home’</strong>;</li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/d8c4f8af61d240945a32fa91df71ec5c.js"></script>



<ul class="wp-block-list"><li>Once we are done with the above steps we will use AdminMiddleware and UserMiddleware in Kernal.php which is in <strong>app/Http/Kernel.php</strong>.</li></ul>



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color">use App\Http\Middleware\AdminMiddleware;
use App\Http\Middleware\UserMiddleware;</span></code></pre>



<ul class="wp-block-list"><li>After that we need to define and for defining we will add the command given below in routeMiddleware.</li></ul>



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color">'admin' =&gt; AdminMiddleware::class,
'user' =&gt; UserMiddleware::class,</span></code></pre>



<ul class="wp-block-list"><li>Now we are almost done with it and need to write the routes for the Admin and the User. </li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/7061dc124e2421b0da98f6792c05e605.js"></script>



<ul class="wp-block-list"><li>Almost done but we need to make the views as well where we can redirect the admin or user once they login.</li></ul>



<p class="wp-block-paragraph">-Create a blade file for Admin dashboard under <strong>resource/views/admin/dashboard.blade.php</strong>.</p>



<p class="wp-block-paragraph">-Create a blade file for User dashboard under <strong>resource/views/user/dashboard.blade.php.</strong></p>



<ul class="wp-block-list"><li>Under the dashboard blades of User and Admin we can write the basic HTML to check whether it is showing it when redirected.</li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/97649d356909a595ee46abe0c281bc3f.js"></script>



<script src="https://gist.github.com/Joydeep-cotocus/773d46c474372fea7049d21c6051d3a6.js"></script>



<p class="wp-block-paragraph"><strong>It&#8217;s good to go now. You can leave a comment if getting any error while following the steps.</strong></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-to-create-multiple-role-based-authentication-in-laravel-5-8/">How to Create Multiple Role Based Authentication in Laravel 5.8</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-to-create-multiple-role-based-authentication-in-laravel-5-8/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Queries</title>
		<link>https://www.scmgalaxy.com/tutorials/sql-queries/</link>
					<comments>https://www.scmgalaxy.com/tutorials/sql-queries/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Mon, 05 Apr 2021 13:03:02 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[alias]]></category>
		<category><![CDATA[Case]]></category>
		<category><![CDATA[count]]></category>
		<category><![CDATA[having]]></category>
		<category><![CDATA[maximum]]></category>
		<category><![CDATA[minimum]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[Update]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5796</guid>

					<description><![CDATA[<p> 👉  To give a table, or a column in a table, a temporary name we can use Alias: For example [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/sql-queries/">SQL Queries</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><strong> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f449.png" alt="👉" class="wp-smiley" style="height: 1em; max-height: 1em;" />  To give a table, or a column in a table, a temporary name we can use Alias:</strong></p>



<pre class="wp-block-code"><code>Syntax: <strong>SELECT "column_name" AS "column_Alias" FROM "table_name";</strong></code></pre>



<p class="wp-block-paragraph">For example we have a table with column_name as &#8220;<strong>SNo&#8221; </strong>, &#8220;<strong>Country</strong>&#8221; and &#8220;<strong>Capital</strong>&#8221; and we want to update it as &#8220;<strong>Serial Number</strong>&#8221; , &#8220;<strong>State</strong>&#8221; and &#8220;<strong>Country_Capital </strong>then we will run the following command:</p>



<script src="https://gist.github.com/Joydeep-cotocus/f6ede3b49a0364ccf16604490c48a399.js"></script>



<p class="wp-block-paragraph"><strong><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f449.png" alt="👉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> To count the number of rows in the table:</strong></p>



<pre class="wp-block-code"><code>Syntax: <strong>SELECT COUNT(column_name) AS (alias_name) FROM table_name;</strong></code></pre>



<p class="wp-block-paragraph">For example we want to count number of orders placed by a particular customer from customer_table:</p>



<script src="https://gist.github.com/Joydeep-cotocus/0436d5c8365a64c8e58995edd2419abd.js"></script>



<p class="wp-block-paragraph">This will show the count of numbers of order places by the customer id &#8220;CG-1234&#8242; and the products ordered.</p>



<p class="wp-block-paragraph"><strong><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f449.png" alt="👉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> To add the values in a columns we use Sum command:</strong></p>



<pre class="wp-block-code"><code>Syntax: <strong>SELECT SUM (column_name) FROM table_name;</strong></code></pre>



<p class="wp-block-paragraph">For example we want to add the profit amount from the sales table:</p>



<script src="https://gist.github.com/Joydeep-cotocus/e9e4a806d7e4275e8f2041fea7b98285.js"></script>



<p class="wp-block-paragraph"><strong><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f449.png" alt="👉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> To find out an average for a column in the table:</strong></p>



<pre class="wp-block-code"><code>Syntax: <strong>SELECT AVG (column_name) FROM table_name;</strong></code></pre>



<p class="wp-block-paragraph">For example we need to find the average age of the customers from customer table:</p>



<script src="https://gist.github.com/Joydeep-cotocus/0fcdd7adfda8ba89bca71e3066372c93.js"></script>



<p class="wp-block-paragraph"><strong><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f449.png" alt="👉" class="wp-smiley" style="height: 1em; max-height: 1em;" />To find the minimum and the maximum value in a table:</strong></p>



<ul class="wp-block-list"><li>Minimum</li></ul>



<pre class="wp-block-code"><code><strong>SELECT MIN (column_name) FROM table_name;</strong></code></pre>



<p class="wp-block-paragraph">For example we want to find the minimum order sale made for a product from sales table:</p>



<script src="https://gist.github.com/Joydeep-cotocus/b6e7bf0b41b16fab3cd213d4eab8f634.js"></script>



<ul class="wp-block-list"><li>Maximum</li></ul>



<pre class="wp-block-code"><code><strong>SELECT MAX (column_name) FROM table_name;</strong></code></pre>



<p class="wp-block-paragraph">For example we want to find the maximum order sale made for a product from sales table:</p>



<script src="https://gist.github.com/Joydeep-cotocus/1015c106530bf6c170620e7d74c34284.js"></script>



<p class="has-text-align-left wp-block-paragraph"><strong><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f449.png" alt="👉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> To groups rows that have the same values into summary rows, like &#8220;find the number of customers in each region&#8221; we use GROUP BY statement. The GROUP BY statement is often used with aggregate functions (COUNT(), MAX(), MIN(), SUM(), AVG()) to group the result-set by one or more columns.</strong></p>



<pre class="wp-block-code"><code>Syntax: <strong>SELECT "column_name","function-type" (column_name) FROM table_name Group By "column-name";</strong></code></pre>



<p class="wp-block-paragraph">For example we need to find the number orders places in each region in the table:</p>



<script src="https://gist.github.com/Joydeep-cotocus/4410047ac5955b5e7d7992b07508ca15.js"></script>



<p class="wp-block-paragraph"><strong><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f449.png" alt="👉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></strong> <strong>To make conditions for aggregate functions we use HAVING clause. The difference between Having clause and Where clause is that we cannot make conditions in aggregate functions whereas we can make conditions in aggregate functions using Having clause.</strong></p>



<pre class="wp-block-code"><code>Syntax: <strong>SELECT column_name, AGGREGATE FUNCTION column_name FROM tables GROUP BY (column1) HAVING condition;</strong></code></pre>



<p class="wp-block-paragraph">For example we have some set of customers in four regions and we want to see in which region the count of customers is more than 200. In this scenario we will use the HAVING clause and set a condition of count more than 200.</p>



<script src="https://gist.github.com/Joydeep-cotocus/a6e3f81522f57ff8686cdcb7c6534dbb.js"></script>



<p class="wp-block-paragraph">This command will show the count of customers in the regions where it is more than 200.</p>



<p class="wp-block-paragraph"><strong><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f449.png" alt="👉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></strong> <strong>To go through a condition and return a value when the first condition is met (like an if-then-else statement) &#8220;CASE&#8221; statement is used. So, once a condition is true, it will stop reading and return the result. If no conditions are true, it returns the value in the <code>ELSE</code> clause.</strong></p>



<pre class="wp-block-code"><code>Syntax: <strong>SELECT * CASE WHEN condition THEN result ELSE result END;</strong></code></pre>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/sql-queries/">SQL Queries</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/sql-queries/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Alter Table in MySql</title>
		<link>https://www.scmgalaxy.com/tutorials/alter-table-in-mysql/</link>
					<comments>https://www.scmgalaxy.com/tutorials/alter-table-in-mysql/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Sat, 03 Apr 2021 12:42:14 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[alter table]]></category>
		<category><![CDATA[Change]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[modify]]></category>
		<category><![CDATA[query]]></category>
		<category><![CDATA[where]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5794</guid>

					<description><![CDATA[<p>In this tutorial we will see the commands which we can use to make changes in our table (as per [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/alter-table-in-mysql/">Alter Table in MySql</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In this tutorial we will see the commands which we can use to make changes in our table (as per <strong>April 2k21</strong>).</p>



<ul class="wp-block-list"><li>To add a column in an existing table:</li></ul>



<pre class="wp-block-code"><code>Syntax: <strong>ALTER TABLE </strong>table_name <strong>ADD </strong>column_name <strong>DATATYPE</strong>;</code></pre>



<ul class="wp-block-list"><li>To delete a column in an existing table:</li></ul>



<pre class="wp-block-code"><code>Syntax: <strong>ALTER TABLE </strong>table_name <strong>DROP </strong>column_name;</code></pre>



<ul class="wp-block-list"><li>To change the data type of a column in an existing table:</li></ul>



<pre class="wp-block-code"><code>Syntax: <strong>ALTER TABLE </strong>table_name <strong>MODIFY COLUMN </strong>column_name <strong>NEW DATA TYPE;</strong></code></pre>



<ul class="wp-block-list"><li>To rename a column in an existing table:</li></ul>



<pre class="wp-block-code"><code>Syntax: <strong>ALTER TABLE</strong> table_name <strong>CHANGE </strong>column_name <strong>NEW_COLUMN_NAME</strong>;</code></pre>



<ul class="wp-block-list"><li>To update the column as NOT NULL Constraint:</li></ul>



<pre class="wp-block-code"><code>Syntax: <strong>ALTER TABLE </strong>table_name <strong>MODIFY </strong>column_name <strong>DATATYPE NOT NULL;</strong></code></pre>



<ul class="wp-block-list"><li>To Sort the data in the Table:</li></ul>



<pre class="wp-block-code"><code>Syntax: <strong>SELECT </strong>"column_name" <strong>FROM </strong>"table-name" &#91;<strong>WHERE </strong>"condition"] <strong>ORDER BY </strong>"column_name" &#91;<strong>ASC/DESC</strong>];</code></pre>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/alter-table-in-mysql/">Alter Table in MySql</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/alter-table-in-mysql/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>MySql queries:</title>
		<link>https://www.scmgalaxy.com/tutorials/mysql-queries/</link>
					<comments>https://www.scmgalaxy.com/tutorials/mysql-queries/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Fri, 02 Apr 2021 12:30:57 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[insert]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[queries]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5790</guid>

					<description><![CDATA[<p>Inserting data into a existing table: Syntax without column names specified: Example: In the example we have inserted the data [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/mysql-queries/">MySql queries:</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph"><strong>Inserting data into a existing table:</strong></p>



<p class="wp-block-paragraph">Syntax without column names specified:</p>



<pre class="wp-block-code"><code>INSERT INTO table_name VALUES ('value1','value2');</code></pre>



<p class="wp-block-paragraph">Example:</p>



<script src="https://gist.github.com/Joydeep-cotocus/e7cfffffea5ffab8fde1dc9144ea6dbc.js"></script>



<p class="wp-block-paragraph">In the example we have inserted the data in a customer_table where we have 4 columns with name cust_id, first_name, last_name, age and we have inserted the data in the columns with this command.</p>



<p class="wp-block-paragraph">Syntax without column names specified:</p>



<pre class="wp-block-code"><code>INSERT INTO table_name ('column1','column2') VALUES ('value1','value2');</code></pre>



<p class="wp-block-paragraph">Example:</p>



<script src="https://gist.github.com/Joydeep-cotocus/2fad1e79c63ad00da25c866ea8bf0ec7.js"></script>



<p class="wp-block-paragraph">In this example we have inserted the data in three columns excluding the last_name column, by doing this it will store the information in all the columns and will show NULL in the last_name.</p>



<p class="wp-block-paragraph"><strong>Inserting data in multiple rows:</strong></p>



<script src="https://gist.github.com/Joydeep-cotocus/6f6678e2ac3440fe59b546a0dcddb297.js"></script>



<ul class="wp-block-list"><li>To &#8216;SELECT&#8217; a statement in a table:</li></ul>



<pre class="wp-block-code"><code>Select column_name from table_name;</code></pre>



<p class="wp-block-paragraph">Following command will show the data stored in the column_name column in the database.</p>



<ul class="wp-block-list"><li>To use &#8216;WHERE&#8217; command in a table:</li></ul>



<pre class="wp-block-code"><code>Select column_name from table_name Where (column_name = condition);</code></pre>



<p class="wp-block-paragraph">For example:</p>



<p class="wp-block-paragraph">We have a table with Customers name , age and email given and we need to see only the data of customer whose age is greater than 25.</p>



<pre class="wp-block-code"><code>Select * from customer_table where age>25;</code></pre>



<p class="wp-block-paragraph">This command will show the data of the customers whose age is greater than 25.</p>



<ul class="wp-block-list"><li>To use logical operators in the query:</li></ul>



<pre class="wp-block-code"><code>Select column_name from table_name Where (column_name = condition) AND (column_name = condition) OR (column_name = condition);</code></pre>



<ul class="wp-block-list"><li>To update data in the table:</li></ul>



<pre class="wp-block-code"><code>UPDATE table_name SET column_name='abc' WHERE condition(column);</code></pre>



<p class="wp-block-paragraph">For example to update the last name of a customer:</p>



<pre class="wp-block-code"><code>UPDATE customer_table SET Last_name='John' WHERE cust_id=5</code></pre>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/mysql-queries/">MySql queries:</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/mysql-queries/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Creating a Table using MySql queries:</title>
		<link>https://www.scmgalaxy.com/tutorials/creating-a-table-using-my-sql-queries/</link>
					<comments>https://www.scmgalaxy.com/tutorials/creating-a-table-using-my-sql-queries/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Thu, 01 Apr 2021 12:37:37 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[query]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5785</guid>

					<description><![CDATA[<p>In this we will learn how we can create tables in the database using sql queries. As we know it [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/creating-a-table-using-my-sql-queries/">Creating a Table using MySql queries:</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In this we will learn how we can create tables in the database using sql queries. As we know it becomes quite complicated to make the tables manually in the database. To ease the process we can follow the steps to make tables using my sql queries.</p>



<p class="wp-block-paragraph"><strong>Syntax:</strong></p>



<pre class="wp-block-code"><code>CREATE TABLE table_name (
    column1 column1 datatype column1 constraint,
    column2 column2 datatype column2 constraint,
    column3 column3 datatype column3 constraint,
   ....
);</code></pre>



<p class="wp-block-paragraph"><strong>Constraints:</strong></p>



<ul class="wp-block-list"><li><strong>NOT NULL CONSTRAINT</strong> &#8211; Ensures that a column cannot have a null value.</li><li><strong>DEFAULT CONSTRAINT</strong> &#8211; Provides a default value for a column when none is specified.</li><li><strong>UNIQUE CONSTRAINT</strong> &#8211; Ensures that all value in a column are different.</li><li><strong>CHECK CONSTRAINT </strong>&#8211; Make sure all values in a column satisfy certian criteria.</li><li><strong>PRIMARY_KEY CONSTRAINT </strong>&#8211; Used to uniquely identify a row in a table.</li><li><strong>FOREIGN_KEY CONSTRAINT </strong>&#8211; Used to ensure referential integrity of the data.</li></ul>



<p class="wp-block-paragraph"><strong>Keys:</strong></p>



<ul class="wp-block-list"><li>A primary key is used to uniquely identify each row in a table.</li><li>A primary key can consists of one or more columns on a table.</li><li>When multiple columns are used as primary key, it is called as Composite key.</li><li>A foreign key is a column (or columns) that references a column (most often primary key) of other table.</li><li>The purpose of foreign key is to referential integrity of the data.</li></ul>



<figure class="wp-block-image size-large"><img decoding="async" width="904" height="362" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/04/Untitled-1.jpg" alt="" class="wp-image-5786" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/04/Untitled-1.jpg 904w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/04/Untitled-1-300x120.jpg 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/04/Untitled-1-768x308.jpg 768w" sizes="(max-width: 904px) 100vw, 904px" /></figure>



<p class="wp-block-paragraph">As shown in the above picture, Cust_ID is the foreign key for order table whereas it is primary key for in the Customer table that means the value of Cust_ID will not change in either of the table.</p>



<p class="wp-block-paragraph">For example we will create a table named as customer_table inside the &#8216;test&#8217; database:</p>



<script src="https://gist.github.com/Joydeep-cotocus/f9cd72fcba465481909e066d538a3eb2.js"></script>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/creating-a-table-using-my-sql-queries/">Creating a Table using MySql queries:</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/creating-a-table-using-my-sql-queries/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>$_GET and $_POST Variable in PHP</title>
		<link>https://www.scmgalaxy.com/tutorials/_get-and-_post-variable-in-php/</link>
					<comments>https://www.scmgalaxy.com/tutorials/_get-and-_post-variable-in-php/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Sat, 27 Mar 2021 12:36:41 +0000</pubDate>
				<category><![CDATA[Programming Scripting Languages]]></category>
		<category><![CDATA[Get]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Post]]></category>
		<category><![CDATA[Variables]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5780</guid>

					<description><![CDATA[<p>$_GET and $_POST is generally used in the forms to transfer data from one file to another file. Both the [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/_get-and-_post-variable-in-php/">$_GET and $_POST Variable in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<ul class="wp-block-list"><li>$_GET and $_POST is generally used in the forms to transfer data from one file to another file. Both the variables are kind of same except when we need to keep our data secure we use $_POST and generally in the form we use $_POST.</li></ul>



<p class="wp-block-paragraph">We will see the explanation by a example:</p>



<p class="wp-block-paragraph"><strong><span style="text-decoration: underline;">Form.html</span></strong></p>



<script src="https://gist.github.com/Joydeep-cotocus/5f21d2415e74cbe7c5809be04bbb7e4c.js"></script>



<p class="wp-block-paragraph"><strong><span style="text-decoration: underline;">Testform.php</span></strong></p>



<script src="https://gist.github.com/Joydeep-cotocus/9e67b2d791cff11c8e3e74b3752ec8fa.js"></script>



<p class="wp-block-paragraph">In this form we have used &#8220;<strong>get&#8221;</strong> method and we will see the output below:</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="639" height="375" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-11.jpg" alt="" class="wp-image-5750" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-11.jpg 639w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-11-300x176.jpg 300w" sizes="auto, (max-width: 639px) 100vw, 639px" /></figure></div>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="508" height="327" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-12.jpg" alt="" class="wp-image-5751" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-12.jpg 508w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-12-300x193.jpg 300w" sizes="auto, (max-width: 508px) 100vw, 508px" /></figure></div>



<p class="wp-block-paragraph">As we can see we have used the method &#8220;<strong>get</strong>&#8221; in the form and in the output page of testform.php we can see the input given, also with that in the URL box we can see the details which we have provided in the form.html.</p>



<p class="wp-block-paragraph">If we use &#8220;<strong>post</strong>&#8221; method in the form.html we will see the difference below:</p>



<script src="https://gist.github.com/Joydeep-cotocus/9870ae337e5d82f7959e3c4c4d0330c7.js"></script>



<script src="https://gist.github.com/Joydeep-cotocus/dd56adf2588ad8404266028b3f4e0145.js"></script>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="438" height="257" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-13.jpg" alt="" class="wp-image-5752" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-13.jpg 438w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-13-300x176.jpg 300w" sizes="auto, (max-width: 438px) 100vw, 438px" /></figure></div>



<p class="wp-block-paragraph">As we can see in the URL box there is no such details provided which we can see while using &#8220;<strong>post</strong>&#8221; method.</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/_get-and-_post-variable-in-php/">$_GET and $_POST Variable in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/_get-and-_post-variable-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Super Global Variables in PHP</title>
		<link>https://www.scmgalaxy.com/tutorials/super-global-variables-in-php/</link>
					<comments>https://www.scmgalaxy.com/tutorials/super-global-variables-in-php/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Wed, 24 Mar 2021 12:06:58 +0000</pubDate>
				<category><![CDATA[Programming Scripting Languages]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Post]]></category>
		<category><![CDATA[Request]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[Session]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5747</guid>

					<description><![CDATA[<p>What is Super Global Variable? Super global variable is a variable which can be used in two different files for [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/super-global-variables-in-php/">Super Global Variables in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<ul class="wp-block-list"><li><strong>What is Super Global Variable?</strong></li></ul>



<p class="wp-block-paragraph">Super global variable is a variable which can be used in two different files for manipulation.</p>



<div class="wp-block-image is-style-default"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Untitled.jpg" alt="" class="wp-image-5748" width="725" height="260" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Untitled.jpg 683w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Untitled-300x108.jpg 300w" sizes="auto, (max-width: 725px) 100vw, 725px" /></figure></div>



<p class="wp-block-paragraph">For example we have a variable &#8220;<strong>a</strong>&#8221; in <strong>File1.php</strong> and we need to print, edit or any manipulation needed to be done in the variable in <strong>File2.php</strong> then we have to use <strong>Super Global Variable </strong>as a variable in <strong>File1.php</strong>.</p>



<ul class="wp-block-list"><li><strong>Types of Super Global Variable</strong> <strong>in PHP:-</strong></li></ul>



<p class="wp-block-paragraph">     &#8211; $_GET</p>



<p class="wp-block-paragraph">     &#8211; $_POST</p>



<p class="wp-block-paragraph">     &#8211; $_REQUEST</p>



<p class="wp-block-paragraph">     &#8211; $_COOKIE</p>



<p class="wp-block-paragraph">     &#8211; $_SESSION</p>



<p class="wp-block-paragraph">     &#8211; $_FILES</p>



<ul class="wp-block-list"><li>To see the u<strong>se of variable $_GET and $_POST</strong> follow the link given below:</li></ul>



<p class="wp-block-paragraph">/<a href="https://www.scmgalaxy.com/tutorials/_get-and-_post-variable-in-php/" data-type="URL" data-id="https://www.scmgalaxy.com/tutorials/_get-and-_post-variable-in-php/">https://www.scmgalaxy.com/tutorials/_get-and-_post-variable-in-php/</a></p>



<ul class="wp-block-list"><li><strong>Use of variable $_REQUEST</strong></li></ul>



<p class="wp-block-paragraph">&nbsp;<strong>$_REQUEST</strong>&nbsp;can catch the data which is sent using both <strong>POST </strong>&amp;&nbsp;<strong>GET</strong>&nbsp;methods whereas <strong>$_GET </strong>and <strong>$_POST </strong>can catch the data which is sent by get and post.</p>



<ul class="wp-block-list"><li><strong>Use of variable $_SERVER</strong></li></ul>



<p class="wp-block-paragraph">When we use $_SERVER we can extract extra data from the client when the form is filled. Extra data in a sense we can extract:</p>



<p class="wp-block-paragraph">     &#8211; HTTP Connection</p>



<p class="wp-block-paragraph">     &#8211; Server Information</p>



<p class="wp-block-paragraph">     &#8211; Host Information</p>



<p class="wp-block-paragraph">     &#8211; URL Information</p>



<p class="wp-block-paragraph">We can see it with the example given below:</p>



<script src="https://gist.github.com/Joydeep-cotocus/f7edd33ae6249bf13b9410a1e2c11690.js"></script>



<p class="wp-block-paragraph">Now when we insert the data in the form.html we will see the following information:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="546" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-15-1024x546.jpg" alt="" class="wp-image-5754" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-15-1024x546.jpg 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-15-300x160.jpg 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-15-768x409.jpg 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-15.jpg 1366w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<ul class="wp-block-list"><li><strong>Use of $_COOKIE variable:</strong></li></ul>



<p class="wp-block-paragraph">Cookies are small file that the server embeds on the user&#8217;s computer each time the same computer requests a page with a browser it will send the cookie too. With PHP, we can both create and retrieve cookie values.</p>



<p class="wp-block-paragraph">To create a cookie we need to run the following command:</p>



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color">setcookie()</span></code></pre>



<p class="wp-block-paragraph"><strong>Syntax:</strong></p>



<pre class="wp-block-code"><code><span class="has-inline-color has-vivid-red-color">setcookie(name, value, expire, path, domain, secure, httponly);</span></code></pre>



<p class="wp-block-paragraph">In the syntax only the name parameter is mandatory rest other parameters are optional.</p>



<p class="wp-block-paragraph">Example for creating a cookie:</p>



<script src="https://gist.github.com/Joydeep-cotocus/3cd00ee44b1dac2f1ceda0405a18979c.js"></script>



<ul class="wp-block-list"><li><strong>Use of $_SESSION variable</strong></li></ul>



<p class="wp-block-paragraph">For session variable refer the link given below:</p>



<p class="wp-block-paragraph"><blockquote class="wp-embedded-content" data-secret="xWUEbN9Xwv"><a href="https://www.scmgalaxy.com/tutorials/how-session-works-in-php/">How Session works in PHP</a></blockquote><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  title="&#8220;How Session works in PHP&#8221; &#8212; scmGalaxy" src="https://www.scmgalaxy.com/tutorials/how-session-works-in-php/embed/#?secret=eLUPc5cjtV#?secret=xWUEbN9Xwv" data-secret="xWUEbN9Xwv" width="600" height="338" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/super-global-variables-in-php/">Super Global Variables in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/super-global-variables-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How Session works in PHP</title>
		<link>https://www.scmgalaxy.com/tutorials/how-session-works-in-php/</link>
					<comments>https://www.scmgalaxy.com/tutorials/how-session-works-in-php/#comments</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Tue, 23 Mar 2021 07:30:33 +0000</pubDate>
				<category><![CDATA[Programming Scripting Languages]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Session]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5733</guid>

					<description><![CDATA[<p>Session is a way to store information (in variables) to be used across multiple pages. We can see the architecture [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-session-works-in-php/">How Session works in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Session is a way to store information (in variables) to be used across multiple pages. We can see the architecture of session workflow below:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="531" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/session-1024x531.jpg" alt="" class="wp-image-5734" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/session-1024x531.jpg 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/session-300x156.jpg 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/session-768x399.jpg 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/session.jpg 1347w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<ul class="wp-block-list"><li>Initially we need to write the command session_start() to start a session.</li><li>Once we write the command server will check if there is a session available.</li></ul>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="541" height="262" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/session_start.jpg" alt="" class="wp-image-5735" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/session_start.jpg 541w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/session_start-300x145.jpg 300w" sizes="auto, (max-width: 541px) 100vw, 541px" /></figure></div>



<ul class="wp-block-list"><li>If there is no server then it will store a cookie in the client machine with the cookie name &#8211; <strong>PHPSESSID</strong> amd it will create a session id of 26 or 32 characters.</li><li>With that it will also store a file on server (Default Location &#8211; C:\xampp\tmp) with session id in the suffix.</li></ul>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="679" height="568" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/cookies.jpg" alt="" class="wp-image-5736" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/cookies.jpg 679w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/cookies-300x251.jpg 300w" sizes="auto, (max-width: 679px) 100vw, 679px" /></figure></div>



<ul class="wp-block-list"><li>If there is already a session in the client machine then it will show the variables stored in the session under (C:\xampp\tmp) the server.</li></ul>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="646" height="358" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Server.jpg" alt="" class="wp-image-5737" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Server.jpg 646w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Server-300x166.jpg 300w" sizes="auto, (max-width: 646px) 100vw, 646px" /></figure></div>



<ul class="wp-block-list"><li>Once we close the browser all the session ends.</li></ul>



<p class="wp-block-paragraph"><strong>Reference</strong>:</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy"  id="_ytid_19253"  width="640" height="360"  data-origwidth="640" data-origheight="360" src="https://www.youtube.com/embed/9n7ZohSRKrQ?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;" class="__youtube_prefs__  epyt-is-override  no-lazyload" title="YouTube player"  allow="fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen data-no-lazy="1" data-skipgform_ajax_framebjll=""></iframe>
</div></figure>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/how-session-works-in-php/">How Session works in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/how-session-works-in-php/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Creating a form and connecting it with database in PHP</title>
		<link>https://www.scmgalaxy.com/tutorials/creating-a-form-and-connecting-it-with-database-in-php/</link>
					<comments>https://www.scmgalaxy.com/tutorials/creating-a-form-and-connecting-it-with-database-in-php/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Mon, 22 Mar 2021 12:42:47 +0000</pubDate>
				<category><![CDATA[Programming Scripting Languages]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[Php]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5726</guid>

					<description><![CDATA[<p>Form View Database constant command to follow DRY rule since this command will be used number of times in a [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/creating-a-form-and-connecting-it-with-database-in-php/">Creating a form and connecting it with database in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<ul class="wp-block-list"><li>Form View</li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/cb517b849c28d8a18c133b0ecf42f958.js"></script>



<ul class="wp-block-list"><li>Database constant command to follow DRY rule since this command will be used number of times in a project to make a connection:</li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/6cdeb6f1a3936c317b0ff8a1100b61e8.js"></script>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/creating-a-form-and-connecting-it-with-database-in-php/">Creating a form and connecting it with database in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/creating-a-form-and-connecting-it-with-database-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Data types in PHP (Array)</title>
		<link>https://www.scmgalaxy.com/tutorials/data-types-in-php-array/</link>
					<comments>https://www.scmgalaxy.com/tutorials/data-types-in-php-array/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Sat, 20 Mar 2021 12:59:18 +0000</pubDate>
				<category><![CDATA[Programming Scripting Languages]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[Php]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5623</guid>

					<description><![CDATA[<p>In this tutorial we will learn about Array data type in PHP, before that you can see all the data [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/data-types-in-php-array/">Data types in PHP (Array)</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In this tutorial we will learn about Array data type in PHP, before that you can see all the data types in PHP given below:</p>



<ul class="wp-block-list"><li>String</li><li>Integer</li><li>Float</li><li>Boolean</li><li>Array</li><li>Object</li><li>Null</li></ul>



<p class="wp-block-paragraph">In PHP we have a special data type where we can assign number of values in single variable using array.</p>



<p class="wp-block-paragraph">For example: $a = array(10,20,30);<br></p>



<p class="wp-block-paragraph">In PHP, there are three types of arrays:</p>



<ul class="wp-block-list"><li>Indexed array</li><li>Associative array</li><li>Multidimensional array</li></ul>



<p class="wp-block-paragraph"><strong>Indexed array</strong>:- PHP indexed array&nbsp;is an&nbsp;array&nbsp;which is represented by an&nbsp;index&nbsp;number by default. All elements of&nbsp;array&nbsp;are represented by an&nbsp;index&nbsp;number which starts from 0.&nbsp;PHP indexed array&nbsp;can store numbers, strings or any object.&nbsp;PHP indexed array&nbsp;is also known as numeric&nbsp;array.</p>



<p class="wp-block-paragraph">Example:</p>



<script src="https://gist.github.com/Joydeep-cotocus/f64ebfbcd06fcbf98bb02bdfbecc42f9.js"></script>



<p class="wp-block-paragraph">Output:</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="387" height="145" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-9.jpg" alt="" class="wp-image-5624" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-9.jpg 387w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-9-300x112.jpg 300w" sizes="auto, (max-width: 387px) 100vw, 387px" /></figure></div>



<p class="wp-block-paragraph">We can also use &lt;pre&gt; tag to print both the key and value in the output.</p>



<script src="https://gist.github.com/Joydeep-cotocus/676fab138b378d431dc7d458485e5911.js"></script>



<p class="wp-block-paragraph">Output:</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="402" height="194" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-10.jpg" alt="" class="wp-image-5625" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-10.jpg 402w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-10-300x145.jpg 300w" sizes="auto, (max-width: 402px) 100vw, 402px" /></figure></div>



<p class="wp-block-paragraph">Another way to write the array in PHP which shows the same output as above:</p>



<script src="https://gist.github.com/Joydeep-cotocus/3da673201a1910649095ce29f7fb4f4a.js"></script>



<script src="https://gist.github.com/Joydeep-cotocus/5bf12126ac639c484888aeec9b01dbc7.js"></script>



<p class="wp-block-paragraph"></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/data-types-in-php-array/">Data types in PHP (Array)</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/data-types-in-php-array/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Difference between Single quotes &#8216; and Double quotes &#8221; in PHP</title>
		<link>https://www.scmgalaxy.com/tutorials/difference-between-single-quotes-and-double-quotes-in-php/</link>
					<comments>https://www.scmgalaxy.com/tutorials/difference-between-single-quotes-and-double-quotes-in-php/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Thu, 18 Mar 2021 09:11:35 +0000</pubDate>
				<category><![CDATA[Programming Scripting Languages]]></category>
		<category><![CDATA[Php]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5619</guid>

					<description><![CDATA[<p>In this tutorial we will learn about the difference in single quotes and double quotes. Theoretically if we understand then [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/difference-between-single-quotes-and-double-quotes-in-php/">Difference between Single quotes &#8216; and Double quotes &#8221; in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In this tutorial we will learn about the difference in single quotes and double quotes. Theoretically if we understand then single quotes doesn&#8217;t parse the data and double quotes is said to be interpreted.</p>



<p class="wp-block-paragraph">In simple words if we understand then if we write anything in double quotes then it passes the value in the variable whereas if we write anything inside single quotes then it passes the value as string. We will see it though example to make it clear.</p>



<script src="https://gist.github.com/Joydeep-cotocus/01951d73181fc16a72ae0a8ad65bd343.js"></script>



<p class="wp-block-paragraph">  Output:</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="435" height="162" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-8.jpg" alt="" class="wp-image-5620" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-8.jpg 435w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-8-300x112.jpg 300w" sizes="auto, (max-width: 435px) 100vw, 435px" /></figure></div>



<p class="wp-block-paragraph">It shows that if we write within the single quotes it doesn&#8217;t parse the data and shows the value as string.</p>



<ul class="wp-block-list"><li>One more thing we should know that we cannot use Single quotes within single quotes and Double quotes within double quotes.</li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/48ed0a4ecb6ca793d58b30892dda760c.js"></script>



<p class="wp-block-paragraph">This is a wrong way of using quotes and we will fetch an error if it is compiled instead of this we can use the below format:</p>



<script src="https://gist.github.com/Joydeep-cotocus/8b071004770872bbe5013f053957b42b.js"></script>



<ul class="wp-block-list"><li>To use double quotes within double quotes and single quotes within single quotes then we have to use skip &#8220;\&#8221;.</li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/25b77d4ce5d30a6ac9cfb6b1288455ae.js"></script>



<p class="wp-block-paragraph">Reference:</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy"  id="_ytid_77097"  width="640" height="360"  data-origwidth="640" data-origheight="360" src="https://www.youtube.com/embed/W8I4ZbAplOo?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;" class="__youtube_prefs__  epyt-is-override  no-lazyload" title="YouTube player"  allow="fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen data-no-lazy="1" data-skipgform_ajax_framebjll=""></iframe>
</div></figure>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/difference-between-single-quotes-and-double-quotes-in-php/">Difference between Single quotes &#8216; and Double quotes &#8221; in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/difference-between-single-quotes-and-double-quotes-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is var_dump in PHP</title>
		<link>https://www.scmgalaxy.com/tutorials/what-is-var_dump-in-php/</link>
					<comments>https://www.scmgalaxy.com/tutorials/what-is-var_dump-in-php/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Thu, 18 Mar 2021 07:01:05 +0000</pubDate>
				<category><![CDATA[Programming Scripting Languages]]></category>
		<category><![CDATA[data types]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[var_dump]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5616</guid>

					<description><![CDATA[<p>Var_dump function is used to check the data type of a variable. In PHP we do not have to write [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/what-is-var_dump-in-php/">What is var_dump in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Var_dump function is used to check the data type of a variable. In PHP we do not have to write the data type while declaring the variable so if we want to print the data type we will use &#8220;<strong>var_dump&#8221; </strong>function to see type of data of the variable.</p>



<p class="wp-block-paragraph">For example:</p>



<script src="https://gist.github.com/Joydeep-cotocus/fd7cd7dcece1983ecd4fa94794cd91db.js"></script>



<p class="wp-block-paragraph">Output:-</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="268" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-7-1024x268.jpg" alt="" class="wp-image-5617" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-7-1024x268.jpg 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-7-300x78.jpg 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-7-768x201.jpg 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-7.jpg 1101w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Here, we can see in the output that it has printed the data type of all the variables which we have used.</p>



<p class="wp-block-paragraph">Reference:</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy"  id="_ytid_93961"  width="640" height="360"  data-origwidth="640" data-origheight="360" src="https://www.youtube.com/embed/eT8e9T6B6As?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;" class="__youtube_prefs__  epyt-is-override  no-lazyload" title="YouTube player"  allow="fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen data-no-lazy="1" data-skipgform_ajax_framebjll=""></iframe>
</div></figure>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/what-is-var_dump-in-php/">What is var_dump in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/what-is-var_dump-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>PHP Global and Local Variable</title>
		<link>https://www.scmgalaxy.com/tutorials/php-global-and-local-variable/</link>
					<comments>https://www.scmgalaxy.com/tutorials/php-global-and-local-variable/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Thu, 18 Mar 2021 06:13:54 +0000</pubDate>
				<category><![CDATA[Programming Scripting Languages]]></category>
		<category><![CDATA[Global]]></category>
		<category><![CDATA[local]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Variables]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5611</guid>

					<description><![CDATA[<p>In this tutorial we will learn about declaring global and local variable in PHP. Initially we will see what is [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/php-global-and-local-variable/">PHP Global and Local Variable</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">In this tutorial we will learn about declaring global and local variable in PHP.</p>



<p class="wp-block-paragraph">Initially we will see what is local variable and global variable with examples.</p>



<script src="https://gist.github.com/Joydeep-cotocus/93d822ce08097ab92e1f296f66bb6367.js"></script>



<p class="wp-block-paragraph">Here if we see the variable is declared inside the function &#8220;local&#8221; so it will work inside the local function only until we return the value inside the function.</p>



<script src="https://gist.github.com/Joydeep-cotocus/52b1f9707b6a87b5946b9a54501582ee.js"></script>



<p class="wp-block-paragraph">In this we can see that the variable &#8220;a&#8221; is declared outside the function local, so it won&#8217;t work inside the function until we call it.</p>



<script src="https://gist.github.com/Joydeep-cotocus/852dcd515b4fa7442a7426362f1a8aab.js"></script>



<p class="wp-block-paragraph">If we see the output for this we will see an error since &#8220;a&#8221; is a local variable and it will not work beyond the function &#8220;test&#8221;.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="583" height="192" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-4.jpg" alt="" class="wp-image-5612" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-4.jpg 583w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-4-300x99.jpg 300w" sizes="auto, (max-width: 583px) 100vw, 583px" /></figure></div>



<script src="https://gist.github.com/Joydeep-cotocus/a8bb1d2e2d31211d5b38d87bbda6e0fe.js"></script>



<p class="wp-block-paragraph">Now in this code if we see, variable &#8220;a&#8221; is declared globally and we will get an error if we call it inside any function.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="538" height="182" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-5.jpg" alt="" class="wp-image-5613" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-5.jpg 538w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-5-300x101.jpg 300w" sizes="auto, (max-width: 538px) 100vw, 538px" /></figure></div>



<p class="wp-block-paragraph">To execute the global variable in the function we need to use predefined variable &#8220;global&#8221; inside the function.</p>



<script src="https://gist.github.com/Joydeep-cotocus/fde15810d9ffabdd4b27ca2363090cea.js"></script>



<p class="wp-block-paragraph">We will see now that it will return value inside the function as well as outside the function.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="446" height="176" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-6.jpg" alt="" class="wp-image-5614" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-6.jpg 446w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-6-300x118.jpg 300w" sizes="auto, (max-width: 446px) 100vw, 446px" /></figure></div>



<p class="wp-block-paragraph">References:</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy"  id="_ytid_57954"  width="640" height="360"  data-origwidth="640" data-origheight="360" src="https://www.youtube.com/embed/EUqK-1Xdb38?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;" class="__youtube_prefs__  epyt-is-override  no-lazyload" title="YouTube player"  allow="fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen data-no-lazy="1" data-skipgform_ajax_framebjll=""></iframe>
</div></figure>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/php-global-and-local-variable/">PHP Global and Local Variable</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/php-global-and-local-variable/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Introduction to Object Oriented Programming in PHP</title>
		<link>https://www.scmgalaxy.com/tutorials/introduction-to-object-oriented-programming-in-php/</link>
					<comments>https://www.scmgalaxy.com/tutorials/introduction-to-object-oriented-programming-in-php/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Wed, 17 Mar 2021 12:39:18 +0000</pubDate>
				<category><![CDATA[Programming Scripting Languages]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[objects]]></category>
		<category><![CDATA[oops]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Programming]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5592</guid>

					<description><![CDATA[<p>OOPs stands for Object Oriented Programming which is all about creating class and objects. Class serves as a template and [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/introduction-to-object-oriented-programming-in-php/">Introduction to Object Oriented Programming in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">OOPs stands for Object Oriented Programming which is all about creating class and objects. Class serves as a template and multiple objects can be created using the class.</p>



<p class="wp-block-paragraph">Oops concept reduces code repetition. Classes are templates for creating objects.</p>



<p class="wp-block-paragraph">For an example, if we see a game take it as a Racing game where we will be having multiple cars which will be running there. So in this case either we have to write codes for each car individually or else we can create a class for car and then we can use it multiple times for the other class with that class name.</p>



<figure class="wp-block-image size-large is-style-default"><img loading="lazy" decoding="async" width="1024" height="579" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/1-3-1024x579.jpg" alt="" class="wp-image-5599" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/1-3-1024x579.jpg 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/1-3-300x170.jpg 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/1-3-768x434.jpg 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/1-3.jpg 1429w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<script src="https://gist.github.com/Joydeep-cotocus/910ddc56a403643a574b3a3b24342ab3.js"></script>



<p class="wp-block-paragraph">A class is a self-contained, independent collection of variables and functions which work together to perform one or more specific tasks, while objects are individual instances of a class.</p>



<p class="wp-block-paragraph">We can see an example given below:</p>



<script src="https://gist.github.com/Joydeep-cotocus/fcb16a12f16b40b0906dbd233b5ea540.js"></script>



<p class="wp-block-paragraph">References:</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy"  id="_ytid_82466"  width="640" height="360"  data-origwidth="640" data-origheight="360" src="https://www.youtube.com/embed/jd55b-T6cHs?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;" class="__youtube_prefs__  epyt-is-override  no-lazyload" title="YouTube player"  allow="fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen data-no-lazy="1" data-skipgform_ajax_framebjll=""></iframe>
</div></figure>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/introduction-to-object-oriented-programming-in-php/">Introduction to Object Oriented Programming in PHP</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/introduction-to-object-oriented-programming-in-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SASS tutorial for Beginners</title>
		<link>https://www.scmgalaxy.com/tutorials/sass-tutorial-for-beginners/</link>
					<comments>https://www.scmgalaxy.com/tutorials/sass-tutorial-for-beginners/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Tue, 16 Mar 2021 13:09:35 +0000</pubDate>
				<category><![CDATA[Programming Scripting Languages]]></category>
		<category><![CDATA[sass]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[scss]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5561</guid>

					<description><![CDATA[<p>SASS is preprocessor of CSS, we can also refer it as CSS with superpower. SASS stands for Syntactically Awesome Style [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/sass-tutorial-for-beginners/">SASS tutorial for Beginners</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">SASS is preprocessor of CSS, we can also refer it as CSS with superpower. SASS stands for Syntactically Awesome Style Sheets.</p>



<p class="wp-block-paragraph">To save the file in SASS format we need to add .scss extension in the file.</p>



<p class="wp-block-paragraph">Here we will learn how to use SASS in Visual Studio Code.</p>



<p class="wp-block-paragraph">Initially in VSC we need to make a basic html file naming index.html and a folder for SASS naming sass. </p>



<script src="https://gist.github.com/Joydeep-cotocus/15f43ba18c2672a21de4a2f5efd96f0b.js"></script>



<p class="wp-block-paragraph">Inside the sass folder we need to create a file naming main.scss.</p>



<p class="wp-block-paragraph">Before executing the file we need to install an extension in our Visual Studio Code named as &#8220;Live Sass Compiler&#8221; which is shown below:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="763" height="196" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture.jpg" alt="" class="wp-image-5562" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture.jpg 763w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-300x77.jpg 300w" sizes="auto, (max-width: 763px) 100vw, 763px" /></figure>



<p class="wp-block-paragraph">Once we install the extension we can see an option Live Sass in the status bar of Visual Studio Code, we need to click on that to make the Sass live.</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="728" height="26" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-2.jpg" alt="" class="wp-image-5564" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-2.jpg 728w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-2-300x11.jpg 300w" sizes="auto, (max-width: 728px) 100vw, 728px" /></figure>



<p class="wp-block-paragraph">If the status changes to &#8220;watching&#8221; automatically we can see that in the Scss folder main.css and main.css.map files are created.</p>



<p class="wp-block-paragraph">Now whatever code we execute in main.scss it will be imported automatically to the main.css file.</p>



<p class="wp-block-paragraph">Also we have to pay attention in linking the css script with the html file, as we will not link main.scss file in the html rather we will link main.css file in the html file.</p>



<p class="wp-block-paragraph">Now we can start styling our file in main.scss and automatically all the codes will be imported in main.css and if it requires any conversion for being compatible with browser it will convert the codes automatically and make it compatible.</p>



<ul class="wp-block-list"><li>Key features of Sass which make it better than CSS is we can use :-</li></ul>



<p class="wp-block-paragraph">&#8211; Operators</p>



<p class="wp-block-paragraph">&#8211; Variables</p>



<p class="wp-block-paragraph">-Nesting</p>



<p class="wp-block-paragraph">-Mixin</p>



<p class="wp-block-paragraph">-Parameter</p>



<p class="wp-block-paragraph">-Partials</p>



<p class="wp-block-paragraph">It make it convenient for us to execute complicated codes very easily with these features.</p>



<p class="wp-block-paragraph">Now we will see the features in details:-</p>



<ul class="wp-block-list"><li><strong>Operators </strong>&#8211; We can use operators in Scss as shown below:</li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/2aad2bf91cedcfd32bd9615c85ec4f12.js"></script>



<p class="wp-block-paragraph">And if we see the same code in main.css we will see the actual values without the operators:</p>



<script src="https://gist.github.com/Joydeep-cotocus/414eba134b02dd4f39c95d67789587bb.js"></script>



<ul class="wp-block-list"><li><strong>Variables </strong>&#8211; We can use variables in scss as shown below:</li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/647b8ed8e2b80f69e315e13e56f8aef2.js"></script>



<p class="wp-block-paragraph">Here we can see that we have declared a variable named as $bg-color and we have assigned a color to it and we can assign the same variable where we want to use that color.</p>



<ul class="wp-block-list"><li><strong>Nesting </strong>&#8211; We can use nesting in scss as shown below:</li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/a9cab6862b8ddefa6d8c3d8f365b8c1d.js"></script>



<p class="wp-block-paragraph">Here we can see that inside the class main_header itself we have assigned the values for &lt;h1> and &lt;h2>.</p>



<ul class="wp-block-list"><li><strong>Mixin </strong>&#8211; We can use mixin in scss as shown below:</li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/1c525b68fc8441cbf5fe954ea01b7104.js"></script>



<p class="wp-block-paragraph">With the help of mixin feature we can use a set of codes which is suppose to be used number of times in the project, we can assign that set of codes under @mixin file name{} and we can just use the name with @include in the front wherever we want to add those codes.</p>



<ul class="wp-block-list"><li><strong>Parameter</strong> &#8211; We can use parameter in scss as shown below:</li></ul>



<script src="https://gist.github.com/Joydeep-cotocus/9f317facd2f425bd087d0a0928039ae4.js"></script>



<p class="wp-block-paragraph">In this feature we can use parameters under the mixin feature. In the Line 16 we can see that we have created a mixin named as &#8220;name2&#8221; in which we have assigned a parameter &#8220;$rem&#8221; which is assigned in &#8220;letter-spacing&#8221; and we have called that parameter in the line 31 and 38 by giving it a value of &#8220;1rem&#8221;. </p>



<p class="wp-block-paragraph">Similarly we can pass number of parameters to make some changes in the codes which are under the &#8220;mixin&#8221;.</p>



<ul class="wp-block-list"><li><strong>Partials</strong> &#8211; In partials we can make our scss file less complex by making separate files for variables and mixin and then importing those files in the main scss. By this way we can easily make any changes in the mixin and variable without any complexity.</li></ul>



<p class="wp-block-paragraph">We need to keep one thing in mind that we have to use &#8220;_&#8221; while creating the partial files for &#8216;mixin&#8217; and &#8216;variables&#8217; so that it does not make any issue with the main scss file.</p>



<p class="wp-block-paragraph">We can see the example below:</p>



<p class="wp-block-paragraph">_mixin.scss:</p>



<script src="https://gist.github.com/Joydeep-cotocus/e5dec44b06118e34cc8f10d475f5aa9c.js"></script>



<p class="wp-block-paragraph">_variable.scss:</p>



<script src="https://gist.github.com/Joydeep-cotocus/222f72db5fadb57eb1767837b1a2ba4f.js"></script>



<p class="wp-block-paragraph">main.scss:</p>



<script src="https://gist.github.com/Joydeep-cotocus/a874566f6a3ad6b6afec9936b8065793.js"></script>



<p class="wp-block-paragraph">Index.html:</p>



<script src="https://gist.github.com/Joydeep-cotocus/ea6053bff5da159b08aefbd6600931b9.js"></script>



<p class="wp-block-paragraph">main.css:</p>



<script src="https://gist.github.com/Joydeep-cotocus/dbba6f88bc519b1cf2494377f8adee59.js"></script>



<p class="wp-block-paragraph">This is the codes for all the files and we can see the following output:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="472" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-3-1024x472.jpg" alt="" class="wp-image-5584" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-3-1024x472.jpg 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-3-300x138.jpg 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-3-768x354.jpg 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Capture-3.jpg 1346w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">To know more about SASS you can refer the video given below:</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy"  id="_ytid_46301"  width="640" height="360"  data-origwidth="640" data-origheight="360" src="https://www.youtube.com/embed/tEQOdFgUXI4?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;" class="__youtube_prefs__  epyt-is-override  no-lazyload" title="YouTube player"  allow="fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen data-no-lazy="1" data-skipgform_ajax_framebjll=""></iframe>
</div></figure>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/sass-tutorial-for-beginners/">SASS tutorial for Beginners</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/sass-tutorial-for-beginners/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Error with npm update: pngquant binary does not seem to work correctly</title>
		<link>https://www.scmgalaxy.com/tutorials/error-with-npm-update-pngquant-binary-does-not-seem-to-work-correctly/</link>
					<comments>https://www.scmgalaxy.com/tutorials/error-with-npm-update-pngquant-binary-does-not-seem-to-work-correctly/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Mon, 15 Mar 2021 08:41:16 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[NPM error]]></category>
		<category><![CDATA[pngquant binary]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5556</guid>

					<description><![CDATA[<p>While installing npm for my ongoing project I got a error as shown below: To rectify the error I followed [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/error-with-npm-update-pngquant-binary-does-not-seem-to-work-correctly/">Error with npm update: pngquant binary does not seem to work correctly</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">While installing npm for my ongoing project I got a error as shown below:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="955" height="270" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Npm-install-error.jpg" alt="" class="wp-image-5557" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Npm-install-error.jpg 955w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Npm-install-error-300x85.jpg 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Npm-install-error-768x217.jpg 768w" sizes="auto, (max-width: 955px) 100vw, 955px" /></figure>



<p class="wp-block-paragraph">To rectify the error I followed the steps given below and it worked for me:</p>



<p class="wp-block-paragraph"><strong>Step 1: </strong>Run sudo apt-get install libpng-dev.</p>



<p class="wp-block-paragraph"><strong>Step 2:</strong> Run npm install -g pngquant-bin.</p>



<p class="wp-block-paragraph"><strong>Step 3: </strong>Run npm install.</p>



<p class="wp-block-paragraph">References:</p>



<p class="wp-block-paragraph"><a rel="noreferrer noopener" href="https://stackoverflow.com/questions/49308545/error-with-npm-update-pngquant-binary-does-not-seem-to-work-correctly" target="_blank">Click here</a></p>



<p class="wp-block-paragraph"><a href="https://github.com/imagemin/pngquant-bin/issues/78" target="_blank" rel="noreferrer noopener">Click here</a></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/error-with-npm-update-pngquant-binary-does-not-seem-to-work-correctly/">Error with npm update: pngquant binary does not seem to work correctly</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/error-with-npm-update-pngquant-binary-does-not-seem-to-work-correctly/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Failed at the node-sass@4.11.0 postinstall script</title>
		<link>https://www.scmgalaxy.com/tutorials/failed-at-the-node-sass4-11-0-postinstall-script/</link>
					<comments>https://www.scmgalaxy.com/tutorials/failed-at-the-node-sass4-11-0-postinstall-script/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Mon, 15 Mar 2021 06:31:33 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5547</guid>

					<description><![CDATA[<p>While installing npm for my ongoing project I got a error as shown below: To rectify the error I followed [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/failed-at-the-node-sass4-11-0-postinstall-script/">Failed at the node-sass@4.11.0 postinstall script</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">While installing npm for my ongoing project I got a error as shown below:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="954" height="468" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Npm-error.jpg" alt="" class="wp-image-5548" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Npm-error.jpg 954w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Npm-error-300x147.jpg 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/Npm-error-768x377.jpg 768w" sizes="auto, (max-width: 954px) 100vw, 954px" /></figure>



<p class="wp-block-paragraph">To rectify the error I followed the steps given below and Booyah it worked for me:</p>



<p class="wp-block-paragraph">Step 1: Remove node_modules folder.</p>



<p class="wp-block-paragraph"><strong>Step 2:</strong> Remove package-lock.json file.</p>



<p class="wp-block-paragraph"><strong>Step 3: </strong>Run <code>npm install -g --unsafe-perm node-sass</code></p>



<p class="wp-block-paragraph"><strong>Step 4: </strong>Run <code>npm install</code>.</p>



<p class="wp-block-paragraph"><strong>Step 5: </strong>Run npm run dev.</p>



<p class="wp-block-paragraph"><strong>References</strong>:</p>



<p class="wp-block-paragraph"><a rel="noreferrer noopener" href="https://stackoverflow.com/questions/57377373/failed-at-the-node-sass4-11-0-postinstall-script-cannot-manage-to-run-this" target="_blank">Click here</a><br><a rel="noreferrer noopener" href="https://www.codegrepper.com/code-examples/shell/Failed+at+the+node-sass%404.10.0+postinstall+script." target="_blank">Click here</a><br></p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/failed-at-the-node-sass4-11-0-postinstall-script/">Failed at the node-sass@4.11.0 postinstall script</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/failed-at-the-node-sass4-11-0-postinstall-script/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Javascript Basics</title>
		<link>https://www.scmgalaxy.com/tutorials/javascript-basics/</link>
					<comments>https://www.scmgalaxy.com/tutorials/javascript-basics/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Sat, 13 Mar 2021 12:55:46 +0000</pubDate>
				<category><![CDATA[JavaScript]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5540</guid>

					<description><![CDATA[<p>JavaScript is the world&#8217;s most popular programming language. Some of the advantages of javascript are given below: Client side execution [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/javascript-basics/">Javascript Basics</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">JavaScript is the world&#8217;s most popular programming language. Some of the advantages of javascript are given below:</p>



<ul class="wp-block-list"><li>Client side execution</li><li>Validation on browser</li><li>Easy language</li></ul>



<p class="wp-block-paragraph">Disadvantages:</p>



<ul class="wp-block-list"><li>It is comparatively less secure.</li><li>No hardware access</li></ul>



<p class="wp-block-paragraph">Ways of adding javascript:</p>



<p class="wp-block-paragraph">Inline &#8211; We can javascript inside the head tag or the body tag between &lt;script>&#8230;&lt;/script>.</p>



<p class="wp-block-paragraph">External &#8211; We can create a javascript file externally and link it inside the head tag or the body tag between &lt;script>&#8230;&lt;/script>.</p>



<p class="wp-block-paragraph">To link a java file to html file:-</p>



<p class="wp-block-paragraph">&lt;script src=&#8221;abc.js&#8221; type=&#8221;text/script&#8221;> &lt;/script></p>



<p class="wp-block-paragraph">Some of the functions of javascript is given below:-</p>



<ul class="wp-block-list"><li>Write function</li></ul>



<p class="wp-block-paragraph">*document.write()</p>



<ul class="wp-block-list"><li>It displays the content into page.</li><li>If we use this function in the end of the HTML document it will delete all existing HTML.</li><li>It is used only for testing purpose.</li></ul>



<p class="wp-block-paragraph">Ex:- document.write(variable); , document.write(4+2);</p>



<ul class="wp-block-list"><li>Alert function</li></ul>



<p class="wp-block-paragraph">*window.alert()</p>



<ul class="wp-block-list"><li>It displays the data in the alert box.</li><li>It should be used when you want the user to stop and see the alert.</li></ul>



<p class="wp-block-paragraph">Ex:- window.alert(&#8220;hello world&#8221;); , window.alert(&#8220;4+2);</p>



<ul class="wp-block-list"><li>Identifiers</li></ul>



<p class="wp-block-paragraph">It is a name having few letters, numbers and special characters.</p>



<p class="wp-block-paragraph">It is used to identify var, function, symbolic constant and so on.</p>



<p class="wp-block-paragraph">Ex:- X2 , PI , Sigma</p>



<ul class="wp-block-list"><li>Variable</li></ul>



<p class="wp-block-paragraph">It is an identifier or a name which is used to refer a value.</p>



<p class="wp-block-paragraph">It is written with a combination of letters, numbers and special character with first letter being alphabet (Underscore &amp; Dollar) also.</p>



<p class="wp-block-paragraph">Ex:- C , fact , b33 , total_amount</p>



<ul class="wp-block-list"><li>Data type</li></ul>



<p class="wp-block-paragraph">In javascript we do not have to specify type of variable.</p>



<p class="wp-block-paragraph">&#8220;Var&#8221; can hold any type of data like string , number ,  boolean etc</p>



<p class="wp-block-paragraph">Primitive data types:</p>



<figure class="wp-block-table"><table><tbody><tr><th>Data Type</th><th>Description</th></tr><tr><td>String</td><td>represents sequence of characters e.g. &#8220;hello&#8221;</td></tr><tr><td>Number</td><td>represents numeric values e.g. 100</td></tr><tr><td>Boolean</td><td>represents boolean value either false or true</td></tr><tr><td>Undefined</td><td>represents undefined value</td></tr><tr><td>Null</td><td>represents null i.e. no value at all</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">Non-Primitive data types:</p>



<figure class="wp-block-table"><table><tbody><tr><th>Data Type</th><th>Description</th></tr><tr><td>Object</td><td>represents instance through which we can access members</td></tr><tr><td>Array</td><td>represents group of similar values</td></tr><tr><td>RegExp</td><td>represents regular expression</td></tr></tbody></table></figure>



<ul class="wp-block-list"><li>Declaring Variable</li></ul>



<p class="wp-block-paragraph">var roll;</p>



<p class="wp-block-paragraph">roll= name;</p>



<p class="wp-block-paragraph">Here &#8216;roll&#8217; is the variable name and &#8216;name&#8217; is assigning value to variable.</p>



<p class="wp-block-paragraph">If a variable is declared without a value then its value will be undefined.</p>



<p class="wp-block-paragraph">Important points in Javascript:-</p>



<ul class="wp-block-list"><li>Statements are executed one by one as they are written.</li><li>Javascripts program and statements are often called Javascripts code.</li><li>Semicolons separates javascript statements.</li><li>Ending statement with semicolon is not required but it is highly recommended.</li><li>Javascript ignores multiple spaces.</li></ul>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/javascript-basics/">Javascript Basics</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/javascript-basics/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Eloquent and Model in Laravel</title>
		<link>https://www.scmgalaxy.com/tutorials/eloquent-and-model-in-laravel/</link>
					<comments>https://www.scmgalaxy.com/tutorials/eloquent-and-model-in-laravel/#respond</comments>
		
		<dc:creator><![CDATA[Joydeep M]]></dc:creator>
		<pubDate>Sat, 13 Mar 2021 12:17:47 +0000</pubDate>
				<category><![CDATA[Laravel]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[laravel]]></category>
		<guid isPermaLink="false">http://www.scmgalaxy.com/tutorials/?p=5516</guid>

					<description><![CDATA[<p>Here we will discuss about the eloquent ORM and insertion of data to database table via Model. Eloquent model included [&#8230;]</p>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/eloquent-and-model-in-laravel/">Eloquent and Model in Laravel</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Here we will discuss about the eloquent ORM and insertion of data to database table via Model.</p>



<p class="wp-block-paragraph">Eloquent model included with Laravel provides a simple, active record implementation for working with database. Each database table has a corresponding &#8220;model&#8221; which is used to interact with the table.</p>



<p class="wp-block-paragraph">Model allows us to query for data in our tables and also insert new records into the table.</p>



<p class="wp-block-paragraph">First of all we need to create a model and to create a model we can run the command given below:</p>



<pre class="wp-block-code"><code>php artisan make:model Product -a</code></pre>



<p class="wp-block-paragraph">This command will create a model , controller , migration and factory.</p>



<p class="wp-block-paragraph">Once the model is created we can find the model under apps as shown in the image below:</p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/model.jpg" alt="" class="wp-image-5530" width="361" height="498" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/model.jpg 382w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/model-217x300.jpg 217w" sizes="auto, (max-width: 361px) 100vw, 361px" /></figure></div>



<p class="wp-block-paragraph">Now moving forward we can insert details under the migration folder and migrate it in the database:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="790" height="514" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/model-1.jpg" alt="" class="wp-image-5531" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/model-1.jpg 790w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/model-1-300x195.jpg 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/model-1-768x500.jpg 768w" sizes="auto, (max-width: 790px) 100vw, 790px" /></figure>



<p class="wp-block-paragraph">To migrate the data we know we need to execute <em>php artisan migrate</em> command and a table will be created in the database:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="356" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/model-2-1024x356.jpg" alt="" class="wp-image-5532" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/model-2-1024x356.jpg 1024w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/model-2-300x104.jpg 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/model-2-768x267.jpg 768w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/model-2.jpg 1028w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<p class="wp-block-paragraph">Now to insert data in the database we need to provide it in the controller:</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="834" height="463" src="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/model-3.jpg" alt="" class="wp-image-5534" srcset="https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/model-3.jpg 834w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/model-3-300x167.jpg 300w, https://www.scmgalaxy.com/tutorials/wp-content/uploads/2021/03/model-3-768x426.jpg 768w" sizes="auto, (max-width: 834px) 100vw, 834px" /></figure>



<p class="wp-block-paragraph">After executing the command we can run the server and see the output in our browser and we can see the name in the page and also the details will be saved in the database.</p>



<p class="wp-block-paragraph">You can see the video given below for more information:</p>



<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy"  id="_ytid_63319"  width="640" height="360"  data-origwidth="640" data-origheight="360" src="https://www.youtube.com/embed/lBdEZ6_IC3g?enablejsapi=1&#038;list=PLT9miexWCpPXuMenRSnpek96ncK3dXf90&#038;index=16&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;" class="__youtube_prefs__  epyt-is-override  no-lazyload" title="YouTube player"  allow="fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen data-no-lazy="1" data-skipgform_ajax_framebjll=""></iframe>
</div></figure>
<p>The post <a href="https://www.scmgalaxy.com/tutorials/eloquent-and-model-in-laravel/">Eloquent and Model in Laravel</a> appeared first on <a href="https://www.scmgalaxy.com/tutorials">scmGalaxy</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.scmgalaxy.com/tutorials/eloquent-and-model-in-laravel/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
