<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Swati Jaiswal on Medium]]></title>
        <description><![CDATA[Stories by Swati Jaiswal on Medium]]></description>
        <link>https://medium.com/@swatijais271990?source=rss-471b4fd29355------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*0SXjMcBPGnPr_u8O_zZehg.png</url>
            <title>Stories by Swati Jaiswal on Medium</title>
            <link>https://medium.com/@swatijais271990?source=rss-471b4fd29355------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 18:11:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@swatijais271990/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Laravel Interview Questions for Beginner]]></title>
            <link>https://medium.com/@swatijais271990/laravel-interview-questions-for-beginner-6960ba2c2d26?source=rss-471b4fd29355------2</link>
            <guid isPermaLink="false">https://medium.com/p/6960ba2c2d26</guid>
            <category><![CDATA[freshers]]></category>
            <category><![CDATA[framework]]></category>
            <category><![CDATA[laravel]]></category>
            <category><![CDATA[interview-questions]]></category>
            <category><![CDATA[jobs]]></category>
            <dc:creator><![CDATA[Swati Jaiswal]]></dc:creator>
            <pubDate>Tue, 09 Apr 2019 09:45:10 GMT</pubDate>
            <atom:updated>2019-04-09T09:45:10.670Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yHdNN-yl3ugNBkYLfk2D5Q.jpeg" /></figure><p>If you want to know more about Laravel, then check out our <a href="https://www.interviewqueries.com/laravel-interview-questions/">Laravel interview questions</a> which are described below. You can crack any interviews by reading our top interview questions.</p><h4>Some basics question in Laravel interview:</h4><p><strong>1. What is Laravel service container?</strong><br>Service Container in Laravel is a Dependency Injection Container and a Registry for the application. It is one of the most powerful tools for managing class dependencies and performing dependency injection.</p><p><strong>2. What is the latest version of laravel?</strong><br>Laravel 5.7 is released on September 04, 2018 and all access available to everyone. This release introduces several new features and many bug fixes and improvements over 5.6.</p><p><strong>3. What is Tagging?</strong><br>Tagging is a package in Laravel that allow you to tag your content like pages/ post to a keyword.</p><p><strong>4. What are the traits in Laravel?</strong><br>A “Trait” is similar to an abstract class, in that it cannot be instantiated on its own but contains methods that can be used in a concrete class. Traits were introduced in PHP in version 5.4 and are used extensively in the Laravel Framework.</p><p><strong>5. What is Laravel Homestead?</strong><br>Laravel Homestead is an official, pre-packaged Vagrant “box” that provides you a wonderful development environment without requiring you to install PHP, HHVM, a web server, and any other server software on your local machine.</p><p><strong>6. How To Use Delete Query In Laravel?</strong><br>In Laravel 4 Illuminate\Database\Query in a Builder class delete function accepts null as an id parameter. And the behavior of this function implies that if I have something like:<br>DB::table(‘users’)-&amp;gt;where(‘id’, $id)-&amp;gt;delete();<br>And if $id will be passed as null, it will truncate the whole table. Which means that besides standard validation, I have to wrap every delete statement with ! is_null($id) validation.</p><p>Thank you for reading this article.</p><p>Swati Jaiswal(Front End Developer)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6960ba2c2d26" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is php7?]]></title>
            <link>https://medium.com/@swatijais271990/what-is-php7-8e2d58aeeb21?source=rss-471b4fd29355------2</link>
            <guid isPermaLink="false">https://medium.com/p/8e2d58aeeb21</guid>
            <category><![CDATA[tutorials-for-php-7]]></category>
            <category><![CDATA[php]]></category>
            <dc:creator><![CDATA[Swati Jaiswal]]></dc:creator>
            <pubDate>Wed, 03 Apr 2019 11:09:50 GMT</pubDate>
            <atom:updated>2019-04-03T11:09:50.679Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cSEgbID-PTHO2BVhV2vjqA.jpeg" /></figure><p>PHP7 is the latest release in the PHP Programming language that has widened several programming avenues for <a href="https://www.interviewqueries.com/php-7-interview-questions/">PHP</a> coders. It is considered to be the most sought-after programing language that has completely revamped the way web applications are created and developed. Released in December 2015, it offers faster performance, reduced memory consumption, anonymous class options, etc. After Php5, it is the most important version to date.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8e2d58aeeb21" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Delete multiple records in Codeigniter]]></title>
            <link>https://medium.com/@swatijais271990/delete-multiple-records-in-codeigniter-c691d471cb54?source=rss-471b4fd29355------2</link>
            <guid isPermaLink="false">https://medium.com/p/c691d471cb54</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[codeigniter]]></category>
            <dc:creator><![CDATA[Swati Jaiswal]]></dc:creator>
            <pubDate>Sat, 09 Mar 2019 07:53:00 GMT</pubDate>
            <atom:updated>2019-03-09T07:53:00.076Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j9sp6oUVkY0vFGz4HIwlWA.jpeg" /></figure><p>CodeIgniter is a lightweight powerful open source PHP web application framework that provides a simple and elegant platform to create full-featured web applications without the overhead of having the costly build reusable components CodeIgniter is being widely used because it is loosely based on the popular model-view-controller (MVC) development pattern. Being large and easy to understand, it has got a large and active user community thus, making it the second among the most popular framework. Some features that make it an extremely popular choice include:-</p><ul><li>It is so easy and a hassle-free process to migrate from one server hosting to another making it a popular choice among the users of web development.</li><li>It has a small footprint means it is lightweight and has very little overhead which means it lends itself towards fast performance especially when it is compared to the other frameworks.</li><li>It’s also easy to get going as it requires no configuration or a very little one.</li></ul><p>Sometimes, we do have inaccurate or obsolete data that needs to be deleted for making access to our database faster and easier for further use. For instance, moving data from the previous year’s calendar to another set of current years tables. This can be done faster if we have moved or deleted the unwanted or inaccurate data thus, reducing the business costs involved too.</p><p>To have a hassle free deletion of multiple records in <a href="https://www.onlineinterviewquestions.com/codeigniter-interview-questions/">CodeIgniter</a> we can use the checkbox method. You have got two ways:-</p><ul><li>Either you can select each checkbox of the record which is to be deleted.</li><li>Or you can select /Deselect all checkboxes to check or uncheck all rows at once and get them deleted in just one go.</li></ul><p>The Steps needed to do the upward process of deleting multiple records in just a few seconds from a database in CodeIgniter are:-</p><ul><li>Taking out all the user data from MYSQL database and putting them together in an HTML table.</li><li>To Select, multiple records append checkbox with each of them.</li><li>To Select or deselect all records at one go, affix a checkbox in the table header.</li><li>To remove all checked rows in the MYSQL database, do include Delete button.</li><li>The first process involves the creation of a database table to store the data of the user.SQL creates table In the MYSQL database using the following steps and commands</li></ul><p>A code can be like:-</p><pre>CREATE TABLE `users` (<br> `id` int(11) NOT NULL AUTO_INCREMENT,<br> `first_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,<br> `last_name` varchar(100) COLLATE utf8_unicode_ci NOT NULL,<br> `email` varchar(200) COLLATE utf8_unicode_ci NOT NULL,<br> `phone` varchar(15) COLLATE utf8_unicode_ci NOT NULL,<br> `created` datetime NOT NULL,<br> `modified` datetime NOT NULL,<br> `status` tinyint(1) NOT NULL DEFAULT &#39;1&#39; COMMENT &#39;1=Active, 0=Deactive&#39;,<br> PRIMARY KEY (`id`)<br>) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;</pre><h3>Controller (Users.php)</h3><p>The two functions from the users control Construct ( ) and Index ( ) are used further.</p><p><strong>Construct( )</strong> is used to load the user model.</p><p><strong>Index( )</strong> is used</p><ul><li>To fetch data from the database using the get Rows() function.</li><li>To load the data of the user for viewing.</li></ul><p>If the user wants to delete the rows and the request is submitted</p><ul><li>Fetch the ID of the rows to be deleted using the $_POST in PHP.</li><li>To check the ID array should not be empty.</li><li>Using the Delete( ) function to delete the selected rows as mentioned in the ID array.</li><li>And finally giving the message to view.</li></ul><p>And the code for it can be like:-</p><pre>&lt;?php defined(&#39;BASEPATH&#39;) OR exit(&#39;No direct script access allowed&#39;);</pre><pre>class Users extends CI_Controller {<br>    <br>    function __construct() {<br>        parent::__construct();<br>        <br>        // Load user model<br>        $this-&gt;load-&gt;model(&#39;user&#39;);<br>    }<br>    <br>    public function index(){<br>        $data = array();<br>        <br>        // If record delete request is submitted<br>        if($this-&gt;input-&gt;post(&#39;bulk_delete_submit&#39;)){<br>            // Get all selected IDs<br>            $ids = $this-&gt;input-&gt;post(&#39;checked_id&#39;);<br>            <br>             // If id array is not empty<br>            if(!empty($ids)){<br>                // Delete records from the database<br>                $delete = $this-&gt;user-&gt;delete($ids);<br>                <br>                // If delete is successful<br>                if($delete){<br>                    $data[&#39;statusMsg&#39;] = &#39;Selected users have been deleted successfully.&#39;;<br>                }else{<br>                    $data[&#39;statusMsg&#39;] = &#39;Some problem occurred, please try again.&#39;;<br>                }<br>            }else{<br>                $data[&#39;statusMsg&#39;] = &#39;Select at least 1 record to delete.&#39;;<br>            }<br>        }<br>        <br>        // Get user data from the database<br>        $data[&#39;users&#39;] = $this-&gt;user-&gt;getRows();<br>        <br>        // Pass the data to view<br>        $this-&gt;load-&gt;view(&#39;users/index&#39;, $data);<br>    }<br>    <br>}</pre><h3>Model (User.php)</h3><p>The database related works are done in this model like as:- Construct ( ), get Rows( ) and delete( ).</p><p><a href="https://www.onlineinterviewquestions.com/core-php-interview-questions/">Php</a> if ( ! defined(‘BASEPATH’)) exit(‘No direct script access allowed’);</p><pre>class User extends CI_Model{<br>    <br>    function __construct() {<br>        $this-&gt;tblName = &#39;users&#39;;<br>    }<br>    <br>    /*<br>     * Fetch posts data from the database<br>     * @param id returns a single record if specified, otherwise all records<br>     */<br>    function getRows($params = array()){<br>        $this-&gt;db-&gt;select(&#39;*&#39;);<br>        $this-&gt;db-&gt;from($this-&gt;tblName);<br>        <br>        //fetch data by conditions<br>        if(array_key_exists(&quot;where&quot;,$params)){<br>            foreach ($params[&#39;where&#39;] as $key =&gt; $value){<br>                $this-&gt;db-&gt;where($key,$value);<br>            }<br>        }<br>        <br>        if(array_key_exists(&quot;order_by&quot;,$params)){<br>            $this-&gt;db-&gt;order_by($params[&#39;order_by&#39;]);<br>        }<br>        <br>        if(array_key_exists(&quot;id&quot;,$params)){<br>            $this-&gt;db-&gt;where(&#39;id&#39;,$params[&#39;id&#39;]);<br>            $query = $this-&gt;db-&gt;get();<br>            $result = $query-&gt;row_array();<br>        }else{<br>            //set start and limit<br>            if(array_key_exists(&quot;start&quot;,$params) &amp;&amp; array_key_exists(&quot;limit&quot;,$params)){<br>                $this-&gt;db-&gt;limit($params[&#39;limit&#39;],$params[&#39;start&#39;]);<br>            }elseif(!array_key_exists(&quot;start&quot;,$params) &amp;&amp; array_key_exists(&quot;limit&quot;,$params)){<br>                $this-&gt;db-&gt;limit($params[&#39;limit&#39;]);<br>            }<br>            <br>            if(array_key_exists(&quot;returnType&quot;,$params) &amp;&amp; $params[&#39;returnType&#39;] == &#39;count&#39;){<br>                $result = $this-&gt;db-&gt;count_all_results();<br>            }else{<br>                $query = $this-&gt;db-&gt;get();<br>                $result = ($query-&gt;num_rows() &gt; 0)?$query-&gt;result_array():FALSE;<br>            }<br>        }</pre><pre>        //return fetched data<br>        return $result;<br>    }<br>    <br>    /*<br>     * Delete data from the database<br>     * @param id array/int<br>     */<br>    public function delete($id){<br>        if(is_array($id)){<br>            $this-&gt;db-&gt;where_in(&#39;id&#39;, $id);<br>        }else{<br>            $this-&gt;db-&gt;where(&#39;id&#39;, $id);<br>        }<br>        $delete = $this-&gt;db-&gt;delete($this-&gt;tblName);<br>        return $delete?true:false;<br>    }</pre><h3>View (users/index.php)</h3><p>To see the delete confirmation dialog and integrate all checkboxes functionality jQuery is needed and must be included in the library.</p><pre>&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js&quot;&gt;&lt;/script&gt;</pre><p><strong>Delete confirm ( )</strong> is used to check if at least a box has been checked and further giving an alert message if the record definitely wants to be deleted.</p><p><strong>Select /Deselect ( )</strong> all the checkboxes in one go using the jQuery.</p><pre>&lt;script&gt;<br>function delete_confirm(){<br>    if($(&#39;.checkbox:checked&#39;).length &gt; 0){<br>        var result = confirm(&quot;Are you sure to delete selected users?&quot;);<br>        if(result){<br>            return true;<br>        }else{<br>            return false;<br>        }<br>    }else{<br>        alert(&#39;Select at least 1 record to delete.&#39;);<br>        return false;<br>    }<br>}<br> <br>$(document).ready(function(){<br>    $(&#39;#select_all&#39;).on(&#39;click&#39;,function(){<br>        if(this.checked){<br>            $(&#39;.checkbox&#39;).each(function(){<br>                this.checked = true;<br>            });<br>        }else{<br>             $(&#39;.checkbox&#39;).each(function(){<br>                this.checked = false;<br>            });<br>        }<br>    });<br>	<br>    $(&#39;.checkbox&#39;).on(&#39;click&#39;,function(){<br>        if($(&#39;.checkbox:checked&#39;).length == $(&#39;.checkbox&#39;).length){<br>            $(&#39;#select_all&#39;).prop(&#39;checked&#39;,true);<br>        }else{<br>            $(&#39;#select_all&#39;).prop(&#39;checked&#39;,false);<br>        }<br>    });<br>});<br>&lt;/script&gt;</pre><p>The user can select /Deselect multiple rows and accordingly can delete the multiple records in the Codeigniter application.</p><ul><li>First, the data is fetched from the database.</li><li>Then multiple rows to be deleted are selected.</li><li>To check/uncheck all checkboxes, a checkbox is selected under the table header.</li><li>A dialog for confirming the delete appears when the delete button is clicked.</li><li>Selected records are deleted after the confirmation process.</li></ul><pre>Display the status message --&gt;</pre><pre>&lt;?php if(!empty($statusMsg)){ ?&gt;<br>&lt;div class=&quot;alert alert-success&quot;&gt;&lt;?php echo $statusMsg; ?&gt;&lt;/div&gt;<br>&lt;?php } ?&gt;<br> <br>&lt;!-- Users data list --&gt;<br>&lt;form name=&quot;bulk_action_form&quot; action=&quot;&quot; method=&quot;post&quot; onSubmit=&quot;return delete_confirm();&quot;/&gt;<br>    &lt;table class=&quot;bordered&quot;&gt;<br>        &lt;thead&gt;<br>        &lt;tr&gt;<br>            &lt;th&gt;&lt;input type=&quot;checkbox&quot; id=&quot;select_all&quot; value=&quot;&quot;/&gt;&lt;/th&gt;      <br>            &lt;th&gt;First Name&lt;/th&gt;<br>            &lt;th&gt;Last Name&lt;/th&gt;<br>            &lt;th&gt;Email&lt;/th&gt;<br>            &lt;th&gt;Phone&lt;/th&gt;<br>        &lt;/tr&gt;<br>        &lt;/thead&gt;<br>        &lt;?php if(!empty($users)){ foreach($users as $row){ ?&gt;<br>        &lt;tr&gt;<br>            &lt;td align=&quot;center&quot;&gt;&lt;input type=&quot;checkbox&quot; name=&quot;checked_id[]&quot; class=&quot;checkbox&quot; value=&quot;&lt;?php echo $row[&#39;id&#39;]; ?&gt;&quot;/&gt;&lt;/td&gt;       <br>            &lt;td&gt;&lt;?php echo $row[&#39;first_name&#39;]; ?&gt;&lt;/td&gt;<br>            &lt;td&gt;&lt;?php echo $row[&#39;last_name&#39;]; ?&gt;&lt;/td&gt;<br>            &lt;td&gt;&lt;?php echo $row[&#39;email&#39;]; ?&gt;&lt;/td&gt;<br>            &lt;td&gt;&lt;?php echo $row[&#39;phone&#39;]; ?&gt;&lt;/td&gt;<br>        &lt;/tr&gt;<br>        &lt;?php } }else{ ?&gt;<br>            &lt;tr&gt;&lt;td colspan=&quot;5&quot;&gt;No records found.&lt;/td&gt;&lt;/tr&gt;<br>        &lt;?php } ?&gt;<br>    &lt;/table&gt;<br>    &lt;input type=&quot;submit&quot; class=&quot;btn btn-danger&quot; name=&quot;bulk_delete_submit&quot; value=&quot;DELETE&quot;/&gt;<br>&lt;/form&gt;</pre><h3>Conclusion</h3><p>As every database carries a number of records and if the user wants to delete the one — one row at a time, it can be a cumbersome task and would involve a lot of time with more number of errors.</p><p>To save your time and make the code more user-friendly, multiple deletions of records from multiple rows is an excellent process to be included in the CodeIgniter application and this can be incorporated using the checkbox method.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c691d471cb54" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>