Topic: Mysqli

Search Filter using Nodejs and MySQL 0

Search Filter using Nodejs and MySQL

Search Filter using Nodejs and MySQL

In this Post We Will Explain About is Search Filter using Nodejs and MySQL With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Ajax Search Box using Node and MySQL Example

In this post we will show you Best way to implement Ajax Search box using Nodejs and MySQL, hear for Search record with two fields from MYSQL table by using Node.js with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

Ajax Search box using Nodejs and MySQL

we prepare a simple connection by using mysql.createConnection() method of database connect MySQL simple module.There are simple very some things that we have to data define inside our create db connection data methods like localhost host name, simple user name, set your password, and set your database name.

Database details: connect with Node.js

  • set Hostname: localhost
  • database Port number: Set 3306
  • set Username: root
  • set Password: Pakainfo.com
  • simple set Database: Live24u
  • Set Table name: users
  • Fields: user_id and name
  • Server File : Node.js

    step-1 : prepare a connection

    var mysql = require('mysql');
    

    step-2 : Database Connect MYSQL table by using Node.js

    var DB_Conn = mysql.createConnection({
      host: "localhost",
      user: "root",
      password: "[email protected]#fdfjdf",
      database: "Live24u"
    });
    

    step-3 : query() method

    DB_Conn.connect(function(db_error) {
      if (db_error) throw db_error;
      console.log("Connected!");
      var sql = "select * from users where user_id='1' and name='jaydeep'";
    

    step-4 : query() method

    DB_Conn.connect(function(db_error) {
      if (db_error) throw db_error;
      console.log("Connected!");
      var sql = "select * from users where user_id='1' and name='jaydeep'";
    //step-4
      DB_Conn.query(sql, function (db_error, result) {
        if (db_error) throw db_error;
        console.log(result);
      });
    });
    

    Discussing steps that we have followed in our server file:

    1.Require simple MySQL module.
    2.Make Connection some variable using mysql.createConnection() function.
    3.Connect by using con.connect() function.
    4.make a SELECT Simple SQL some query by using data fields set user_id and name.
    5.Execute some query string by using .query() function.
    6.Show data result.

    Connecting nodejs app to Mysql

    You are Most welcome in my you tube Channel Please subscribe my channel. and give me Feed Back.
    More Details……
    Angularjs Example

    Example

    I hope you have Got What is nodejs ajax search bar with javascript ,juquery and mysql database And how it works.I would Like to have Feed Back From My Blog(Pakainfo.com) readers.Your Valuable Feed Back,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

    PHP How-to create Dynamic PDF Files using FPDF 0

    PHP How-to create Dynamic PDF Files using FPDF

    PHP How-to create Dynamic PDF Files using FPDF

    In this Post We Will Explain About is PHP How-to create Dynamic PDF Files using FPDF With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Generating PDF files with PHP and FPDF Example

    In this post we will show you Best way to implement How-to create PDF documents using PHP, hear for Generate PDF from MySQL Data using FPDF with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

    PHP Script to create PDF document using FPDF

    First of all simple, you need to download FPDF libs. Download FPDF from here FPDF Download

    http://www.fpdf.org
    

    and then Keep the include the fpdf.php file in your root working directory,and then keep the font simple directory in the same root place.

    After that Run this source code ,and then you are know or ready with your simple first pdf file created from simple external FPDF class. Example of How to create PDF with PHP

    AddPage();
    $mypdf->SetFont('Arial','B',18);
    $mypdf->Cell(80,10,'Hello World!',1,0,R,true,'http://www.Pakainfo.com');
    $mypdf->Output('live_myfile.pdf','D'); // here Force download using FPDF to user machine as live_myfile.pdf
    ?>
    

    In the above simple source code we have used simple descign cell to add our new create text to the FPDF to pdf file. We have simple just added one text line Like as a ‘Wel-come to Pakainfo.com’ as well as simple created the pdfdouments file. Here more example is the simple details of Cell. Try to change the simple source code script by adding backgroud css color like this.

    $mypdf->SetFillColor(193,229,252);
    $mypdf->Cell(80,10,'Wel-come to Pakainfo.com',1,0,R,true,'http://www.Pakainfo.com');
    $mypdf->Output('live_myfile.pdf','D'); 
    

    We used to simple $mypdf->Output(‘my_file’,’D’) to get some here output simple directly. This line will force download to user machine the pdf file my_file.pdf. We can some data change this to serever side save the data file in local simple data PHP ( server ) side machine.

    $mypdf->Output('live_myfile.pdf','F'); // devloped by live24u Saved at local ( server side )  as live_myfile.pdf
    //$mypdf->Output('live_myfile.pdf','I'); //devloped by live24u Send to browser and simple displayed wiht the plugin, data file can be simple saved using  data set file name. 
    //$mypdf->Output('live_myfile.pdf','S'); //devloped by live24u Output as sting , here simple php file name is ignored.  
    

    You are Most welcome in my youtube Channel Please subscribe my channel. and give me FeedBack.
    More Details……
    Angularjs Example

    Example

    I hope you have Got What is How to create a dynamic PDF using PHP And how it works.I would Like to have FeedBack From My Blog(Pakainfo.com) readers.Your Valuable FeedBack,Any Question,or any Comments about This Article(Pakainfo.com) Are Most Always Welcome.

    PHP Get Current URL Full Path HTTP-HTTPS Protocol 0

    PHP Get Current URL Full Path HTTP-HTTPS Protocol

    PHP Get Current URL Full Path HTTP-HTTPS Protocol

    In this Post We Will Explain About is PHP Get Current URL Full Path HTTP-HTTPS Protocol With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to php get http or https from urlExample

    In this post we will show you Best way to implement PHP Get Site URL Protocol HTTP or HTTPS, hear for php – Identify whether the current url is http or https in a projectwith Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

    php check if url contains http or https using PHP

    <?php
    	$set_domain_name =  $get_current_protocol = $get_current_domain = "";
    	$get_current_protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || 
        $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
        $get_current_domain = $_SERVER['HTTP_HOST'];
        $set_domain_name = $get_current_protocol.$get_current_domain;
    	var_dump(set_domain_name);
    	
    	
        $base_image_url = $set_domain_name."/admin/upload/images/";
    	var_dump(base_image_url);
    	
    	
    	$temp = explode(".", $_FILES["upload"]["name"]);
    	$newfilename = date("Ymd").round(microtime(true)) . '.' . end($temp);
    	move_uploaded_file($_FILES["upload"]["tmp_name"],"images/".$newfilename);
    	$image_url = $base_image_url . $newfilename;
    	
    	echo "<br> Simple Stored in: " . $image_url;
    ?>
    

    PHP Simple Get Site URL Protocol – “HTTP or HTTPS”

    using PHP Simple Check to your current url is http any type of Protocol and get to PHP if condition check.

    How to get current page URL in PHP

    Simple Answer: Use the simple PHP $_SERVER use the Superglobal Variable

    Example

    I hope you have Got What is How To Check URL Protocol Is https by PHP And how it works.I would Like to have FeadBack From My Blog(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.

    How to Insert Data in Database using PHP OOPS 0

    How to Insert Data in Database using PHP OOPS

    How to Insert Data in Database using PHP OOPS

    In this Post We Will Explain About is How to Insert Data in Database using PHP OOPS With Example and Demo.Welcome on Pakainfo.com – Examples, The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to how to fetch data from database in php using oops Example

    In this post we will show you Best way to implement php mysql insert operation in PHP using OOP, hear for insert data in mysql using php class with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

    Setp 1.First create a html form

    Index.php

    	<form name="insert" action="" method="post">
           <table width="100%" border="0">
      <tr>
        <th width="26%" height="50" scope="row users">USER Full Name :</th>
        <td width="74%"></td>
      </tr>
      <tr>
        <th height="50" scope="row users">USER Email :</th>
        <td></td>
      </tr>
      <tr>
        <th height="50" scope="row users">USER Contact no. :</th>
        <td></td>
      </tr>
      <tr>
        <th height="50" scope="row users">USER Gender :</th>
        <td> Male   
    	 Female</td>
      </tr>
       <tr>
        <th height="50" scope="row users">USER Education :</th>
        <td>
    	Select Any one
    	10th
    	12th
    	Graduate
    	Post Graduate
    	 </td>
      </tr>
      <tr>
        <th height="50" scope="row users">USER Address :</th>
        <td><textarea name="user_address" class="form-control">
    	</textarea></td>
      </tr>
      <tr>
        <th height="50" scope="row users"> </th>
        <td></td>
      </tr>
    </table>
     
         </form>
    

    Setp 2. Create a database with name demos

    Inside demos content data base make a table inserdata
    Sample some Structure of user_mst table

    CREATE TABLE IF NOT EXISTS `user_mst` (
    `id` int(11) NOT NULL,
    `name` varchar(255) NOT NULL,
    `email` varchar(255) NOT NULL,
    `phone` bigint(20) NOT NULL,
    `user_gender` varchar(255) NOT NULL,
    `user_edu` varchar(255) NOT NULL,
    `user_user_address` longtext NOT NULL,
    `posting_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
    ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
    

    Setp 3. Create a php page function .php

    Inside this simple page a using class DB_concreate or define. Db_con class contain simple database connection and some insert funtion.

    function .php

    Setp 4.Define a oject and class the insert funtion

    Put this source code at the top of the simple root file index.php page

    insert($user_fname,$email,$user_mobile,$user_gender,$user_edu,$adrss);
    	if($sql)
    	{
    	echo "alert('USER Data inserted');";
    	}
    	else
    	{
    	echo "alert('USER Data not inserted');";
    	}
    }
     ?>
    

    Example

    I hope you have Got What is Objects Orientation in PHP And how it works.I would Like to have FeadBack From My Blog(Pakainfo.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(Pakainfo.com) Are Most Always Welcome.

    Laravel Get Last 7 days month year record from MySQL 0

    Laravel Get Last 7 days month year record

    Today, We want to share with you Laravel Get Last 7 days month year record from MySQL.In this post we will show you get last 7 days data from current date laravel, hear for How to get last 7 days record from table as per date using Laravel and MySQL we will give you demo and example for implement.In this post, we will learn about Selecting all records created last month with Eloquent with an example.

    Laravel Get Last 7 days month year record from MySQL

    There are the Following The simple About Laravel Get Last 7 days month year record from MySQL Full Information With Example and source code.

    As I will cover this Post with live Working example to develop laravel last 7 days query, so the some major files and Directory structures for this example is following below.

    • laravel carbon last 7 days
    • get last 7 days data in laravel without carbon

    How to get last 7 days data using Laravel 5.7?

    $mygetdate = \Carbon\Carbon::today()->subDays(30);
    $members = Member::where('created_at', '>=', $mygetdate)->get();
    dd($members);
    

    Get last 7 days data in laravel without Carbon

    Laravel search for records 7 days old only

    $members = Member::whereRaw('DATE(AppDate) = DATE_SUB(CURDATE(), INTERVAL 7 DAY)')
    

    use whereDate

    ->whereDate('created_at', Carbon::now()->subDays(7))
    ->get();
    

    Get results from 30 days ago in Laravel

    $members = Member::where('created_at', '>=', $date)->get();
    

    Angular 6 CRUD Operations Application Tutorials

    Search Retalted :get last 7 days data in laravel, laravel carbon last 7 days, laravel last 7 days query, eloquent last 7 days, subtract days laravel, laravel carbon last 7 days, get last 7 days data from current date laravel

    Read :

    Summary

    You can also read about AngularJS, ASP.NET, VueJs, PHP.

    I hope you get an idea about Laravel Get Last 7 days, month, year record from MySQL.
    I would like to have feedback on my Pakainfo.com blog.
    Your valuable feedback, question, or comments about this article are always welcome.
    If you enjoyed and liked this post, don’t forget to share.

    Reusable PHP CRUD DATABASE FUNCTIONS 0

    Reusable PHP CRUD DATABASE FUNCTIONS

    Today, We want to share with you Reusable PHP CRUD DATABASE FUNCTIONS.In this post we will show you TIME SAVING DATABASE FUNCTIONS, hear for insert update delete in php using classes we will give you demo and example for implement.In this post, we will learn about crud operations in php using oops with an example.

    Reusable PHP CRUD DATABASE FUNCTIONS

    There are the Following The simple About Reusable PHP CRUD DATABASE FUNCTIONS Full Information With Example and source code.

    As I will cover this Post with live Working example to develop php oop crud pdo, so the sample php application with mysql for this example is following below.

    PHP Reuse a MySQL object in function Examples

    RowUpdateData('my_any_table', $request_data, "WHERE id = '$id'");
    RowDeleteData('my_db_table', "WHERE id = '$id'");
    

    $request_data = array(
        'member_name' => $member_name,
        'sir_name' => $sir_name,
        'profile' => $profile,
        'address1' => $address1,
        'country' => $country,
        'city' => $city,
        'areacode' => $areacode,
        'phone' => $phone,
        'mobile' => $mobile,
        'fb_url' => $fb_url,
        'pay' => $pay,
        'title' => $title,
        'information' => $information,
        'reference' => $reference,
        'time' => time()
    );
    

    function addRowInsertData($db_tbl_name, $request_data)
    {
        // retrieve the keys of the array (column titles)
        $fields = array_keys($request_data);
    
        // build the query
        $sql = "INSERT INTO ".$db_tbl_name."
        (`".implode('`,`', $fields)."`)
        VALUES('".implode("','", $request_data)."')";
    
        // run and return the query result resource
        return mysql_query($sql);
    }
    

    we would create a PHP delete function:

    // the mysql query where clause is left optional incase the user wants to delete every row!
    function RowDeleteData($db_tbl_name, $where_set='')
    {
        // check for optional where clause
        $whereQry = '';
        if(!empty($where_set))
        {
            // check to display if the 'where' keyword exists
            if(substr(strtoupper(trim($where_set)), 0, 5) != 'WHERE')
            {
                // not found, add keyword
                $whereQry = " WHERE ".$where_set;
            } else
            {
                $whereQry = " ".trim($where_set);
            }
        }
        // build the SQL query
        $sql = "DELETE FROM ".$db_tbl_name.$whereQry;
    
        // run and return the query result resource
        return mysql_query($sql);
    }
    

    And then for PHP an update function:

    // again where clause is left optional
    function RowUpdateData($db_tbl_name, $request_data, $where_set='')
    {
        // check for optional where clause
        $whereQry = '';
        if(!empty($where_set))
        {
            // check to see if the 'where' keyword exists
            if(substr(strtoupper(trim($where_set)), 0, 5) != 'WHERE')
            {
                // not found, add key word
                $whereQry = " WHERE ".$where_set;
            } else
            {
                $whereQry = " ".trim($where_set);
            }
        }
        // start the actual SQL statement
        $sql = "UPDATE ".$db_tbl_name." SET ";
    
        // loop and build the column /
        $sets = array();
        foreach($request_data as $column => $value)
        {
             $sets[] = "`".$column."` = '".$value."'";
        }
        $sql .= implode(', ', $sets);
    
        // append the where statement
        $sql .= $whereQry;
    
        // run and return the query result
        return mysql_query($sql);
    }
    

    Angular 6 CRUD Operations Application Tutorials

    Read :

    Summary

    You can also read about AngularJS, ASP.NET, VueJs, PHP.

    I hope you get an idea about Reusable PHP CRUD DATABASE FUNCTIONS.
    I would like to have feedback on my Pakainfo.com blog.
    Your valuable feedback, question, or comments about this article are always welcome.
    If you enjoyed and liked this post, don’t forget to share.

    Laravel Soft Delete Unique validations 0

    Laravel Soft Delete Unique validations

    Today, We want to share with you Laravel Soft Delete Unique validations.In this post we will show you Laravel Validation Unique Soft Delete Example, hear for Soft Delete Cascade using Laravel Eloquent Example we will give you demo and example for implement.In this post, we will learn about how to make unique validations work with soft delete in laravel with an example.

    Laravel Soft Delete Unique validations

    There are the Following The simple About Laravel Soft Delete Unique validations Full Information With Example and source code.

    As I will cover this Post with live Working example to develop Unique Database Fields with Laravel Soft Deletes, so the PHP Laravel Soft Delete Migration cascade for this example is following below.

    Laravel Validation Unique With Soft Delete

    I display you both example below source code, One is for Mysql create time and another is on edit time on Laravel controller validation.

    Laravel Soft Delete Unique On Create Method:

    public function store(Request $request)
    {
        $request->validate([
            'name'=>'required|unique:products,name,NULL,id,deleted_at,NULL',
        ]);
    }
    

    Laravel Soft Delete Unique On Update Method:

    public function update(Request $request, $id)
    {
        $request->validate([
            'name'=>'required|unique:products,name,'.$id.',id,deleted_at,NULL',
        ]);
    }
    

    Example 2: laravel unique ignore soft deleted

    Unique Validations Work With Soft Delete In Laravel

       public function up()
        {
            Schema::create('visitors', function (Blueprint $table) {
                $table->increments('id');
                $table->string('name');
                $table->string('email');
                $table->string('password');
                $table->rememberToken();
                $table->timestamps();
                $table->softDeletes();
    
                $table->unique(['email', 'deleted_at']);
            });
        }
    

    soft deleted user email available

    'email' => 'required|email|max:45|unique:visitors,email,NULL,id,deleted_at,NULL',
    

    laravel validation unique update & Create

    On Insert Soft Delete In Laravel:

        public function store(Request $request)
        {
                //Check Validation for products
                request()->validate([
                    'name' => 'required|min:5|max:50|unique:products,name,NULL,id,deleted_at,NULL',
                    'category_name' => 'required|min:2|max:20|unique:products,category_name,NULL,id,deleted_at,NULL',
                    'branch_prefix' => 'required|min:2|max:20|unique:products,branch_prefix,NULL,id,deleted_at,NULL',
                    'owner_url' => 'required|min:2|max:255|unique:products,owner_url,NULL,id,deleted_at,NULL',
                    'product_doc_url' => 'required|min:2|max:255|unique:products,product_doc_url,NULL,id,deleted_at,NULL',
                ]);
    
                $data = $request->only([
                    'name',
                    'category_name',
                    'branch_prefix',
                    'owner_url',
                    'product_doc_url',
                ]);
    
                Products::create($data);
              return redirect('products')->with('success','product created successfully.');
        }
    

    On Update Soft Delete In Laravel:

        public function update(Request $request, $id = 0)
        {
                request()->validate([
                    'name' => 'required|unique:products,name,'.$id.',id,deleted_at,NULL',
                    'category_name' => 'required|min:2|max:20|unique:products,category_name,'.$id.',id,deleted_at,NULL',
                    'branch_prefix' => 'required|min:2|max:20|unique:products,branch_prefix,'.$id.',id,deleted_at,NULL',
                    'owner_url' => 'required|min:2|max:255|unique:products,owner_url,'.$id.',id,deleted_at,NULL',
                    'product_doc_url' => 'required|min:2|max:255|unique:products,product_doc_url,'.$id.',id,deleted_at,NULL',
                ]);
            $data = $request->only([
                'name',
                'category_name',
                'branch_prefix',
                'owner_url',
                'product_doc_url',
            ]);
    
            $products= \App\Products::find($id);
            $products->name=$request->get('name');
            $products->category_name=$request->get('category_name');
            $products->branch_prefix=$request->get('branch_prefix');
            $products->owner_url=$request->get('owner_url');
            $products->product_doc_url=$request->get('product_doc_url');
    
            $products->save();
           // return redirect('products');
            return redirect('products')
                ->with('success','Product updated successfully.');
    
        }
    

    Angular 6 CRUD Operations Application Tutorials

    Read :

    Summary

    You can also read about AngularJS, ASP.NET, VueJs, PHP.

    I hope you get an idea about Laravel Soft Delete Unique validations.
    I would like to have feedback on my Pakainfo.com blog.
    Your valuable feedback, question, or comments about this article are always welcome.
    If you enjoyed and liked this post, don’t forget to share.

    Laravel Helper Functions with Examples 0

    Laravel Helper Functions with Examples

    Today, We want to share with you Laravel Helper Functions with Examples.In this post we will show you Best Practices for Custom Helpers in Laravel 5.7, hear for include helper file in blade template page we will give you demo and example for implement.In this post, we will learn about Laravel Blade @include Some Additional “Helpers” with an example.

    Laravel Helper Functions with Examples

    There are the Following The simple About Laravel Helper Functions with Examples Full Information With Example and source code.

    As I will cover this Post with live Working example to develop Creating Your Own PHP Helpers in a Laravel Project, so the Most Useful Laravel String Functions(helpers) for this example is following below.

    Laravel Blade @include Additional “Helpers”

    First of all Laravel Blade @include, a simple example:

    @include('includes.header', ['title' => 'Live Page Title'])
    

    1. @includeIf: View May Be Non-Existent

    @includeIf('includes.header', ['title' => 'Live Page Title'])
    

    2. @includeWhen: Include Only With Condition

    @if ($load_header)
      @include('includes.header', ['title' => 'Live Page Title'])
    @endif
    

    @includeWhen($load_header, 'includes.header', ['title' => 'Live Page Title'])
    

    3. @includeFirst: Fallback “Default” View

    @includeFirst('adminlte.header', 'default.header', ['title' => 'Live Page Title'])
    

    Angular 6 CRUD Operations Application Tutorials

    Read :

    Summary

    You can also read about AngularJS, ASP.NET, VueJs, PHP.

    I hope you get an idea about Laravel Helper Functions with Examples.
    I would like to have feedback on my Pakainfo.com blog.
    Your valuable feedback, question, or comments about this article are always welcome.
    If you enjoyed and liked this post, don’t forget to share.

    Difference between two dates in years, months, days in PHP 0

    Difference between two dates in years, months, days in PHP

    Today, We want to share with you Difference between two dates in years, months, days in PHP.In this post we will show you calculate the difference between two dates in PHP, hear for PHP Get difference between two dates in years months days hours minutes we will give you demo and example for implement.In this post, we will learn about php difference between two dates in years months and days with an example.

    Difference between two dates in years, months, days in PHP

    There are the Following The simple About Difference between two dates in years, months, days in PHP Full Information With Example and source code.

    As I will cover this Post with live Working example to develop calculate days between two dates in php, so the PHP Date Exercises Time difference php calculate time difference between two dates in minutes for this example is following below.

    PHP Difference Between Two Dates

    PHP Date Exercises Time difference in days and years, months, days, hours, minutes, seconds between two dates

    $first_date = new DateTime('2019-06-01 02:12:51');
    $second_date = new DateTime('2023-05-12 11:10:00');
    $live_date_diff = $first_date->diff($second_date);
    echo $live_date_diff->days.'Total days'."\n";
    echo $live_date_diff->y.' years'."\n";
    echo $live_date_diff->m.' months'."\n";
    echo $live_date_diff->d.' days'."\n";
    echo $live_date_diff->h.' hours'."\n";
    echo $live_date_diff->i.' minutes'."\n";
    echo $live_date_diff->s.' seconds'."\n";
    

    You can also make a single simple PHP function/Methods to fetch difference between two dates using PHP in years months, days, hours and minutes that will be very helpful for all some filter data or chart or any project. We won’t need to re-write the source code.

    //get Simple difference between two dates in years months, days, hours and minute
    $live_date_diff = getDateDiff('2019-06-01 02:12:51','2022-05-12 11:10:00');
    
    print_r($live_date_diff);
    
    function getDateDiff($first_date,$second_date) {
        $first_date = new DateTime($first_date);
        $second_date = new DateTime($second_date);
        $live_date_diff = $first_date->diff($second_date);
        
        $nodeResult['total_days'] = $live_date_diff->days;
        $nodeResult['years'] = $live_date_diff->y;
        $nodeResult['months'] = $live_date_diff->m;
        $nodeResult['days'] = $live_date_diff->d;
        $nodeResult['hours'] = $live_date_diff->h;
        $nodeResult['minutes'] = $live_date_diff->i;
        $nodeResult['seconds'] = $live_date_diff->s ;
        return $nodeResult;
    }
    

    Angular 6 CRUD Operations Application Tutorials

    Read :

    Summary

    You can also read about AngularJS, ASP.NET, VueJs, PHP.

    I hope you get an idea about Difference between two dates in years, months, days in PHP.
    I would like to have feedback on my Pakainfo.com blog.
    Your valuable feedback, question, or comments about this article are always welcome.
    If you enjoyed and liked this post, don’t forget to share.

    PHP OOP CRUD MVC Framework Tutorial 0

    PHP OOP CRUD MVC Framework Tutorial

    Today, We want to share with you PHP OOP CRUD MVC Framework Tutorial.
    In this post we will show you php Simple MVC example with source code, hear for CRUD with PHP OOP and MVC we will give you demo and example for implement.
    In this post, we will learn about Simple PHP MVC Framework Example with an example.

    Welcome to the In Pakainfo.com website! You will Step By Step learn web programming, easy and very fun. This website allmost provides you with a complete web programming tutorial presented in an easy-to-follow manner. Each web programming tutorial has all the practical examples with web programming script and screenshots available.php Simple MVC example with source code

    Folder Structure :

    ******************
    ===================
    MVC
    ->controller
    –>Controller.php
    ->model
    –>user.php
    –>Model.php
    ->view
    –>userlist.php
    –>viewuser.php
    index.php
    ===================

    Source code : Simple php mvc example

    index.php

    invoke();
    
    ?>
    

    Controller.php

    username = $username;
    	    $this->userfname = $userfname;
    	    $this->userinfo = $userinfo;
        } 
    }
    
    ?>
    

    user.php

    username = $username;
    	    $this->userfname = $userfname;
    	    $this->userinfo = $userinfo;
        } 
    }
    
    ?>
    

    Model.php

     new Users("only playing", "R. dismelp", "student of the atmiya."),
    			"Ravi Korat" => new Users("Moonwalker", "J. Walker", "stud. of th rk collage"),
    			"Pragnesh shah" => new Users("hitesh dhameliya", "news boys", "choklate boys")
    		);
    	}
    	public function getBook($username)
    	{
    		$allBooks = $this->getUserList();
    		return $allBooks[$username];
    	}
    }
    ?>
    

    userlist.php

    <title>php Simple MVC example with source code</title>
    
    <table>
    	<tr><td>User Name</td><td>UserFirstName</td><td>UserInfo</td></tr>
    	 $users)
    		{
    			echo '<tr><td><a>username.'">'.$users->username.'</a></td><td>'.$users->userfname.'</td><td>'.$users->userinfo.'</td></tr>';
    		}
    
    	?>
    </table>
    
    
    

    viewuser.php

    
    
    <title>php Simple MVC example with source code</title>
    
    
    username . '<br />';
    	echo 'userfname:' . $user->userfname . '<br />';
    	echo 'userinfo:' . $user->userinfo . '<br />';
    ?>
    
    
    
    

    MVC run : http://localhost/mvc/