Get Your XAMPP Running Again: Fixing the 'MySQL shutdown unexpectedly' Error

 
Totally stopped the MYSQL running. I restart the xampp server many times but doesn’t work. I don’t know what happened on XAMPP Server.
Finally i found the solution. the problem is MYSQL shutdown unexpectedly.
Solution is,

      1. Exit Xampp and navigate to xampp/mysql/data directory
      2. delete the ibdata1 file
      3. restart the XAMPP server

or

      1. Exit Xampp and navigate to xampp/mysql/data directory
      2. delete the ibdata1, ib_logfile0,ib_logfile1,ib_logfile101 files
      3. restart the XAMPP server

or

Try to check the error log at the installed location: /xampp/mysql/data/mysql_error.log
This can help you better debug the problem.
Also Note:

     1. XAMPP might hit into port issue when you have skype also running.
     2. There is a federated plugin issue that is common.

Only by looking at the logs, we can find the exact issue. Hope this helps.

Thank You !!!

Comparing echo and print: Understanding the Differences in PHP

In php echo and print both are used for showing output on the user screen.

Here we are going to discuss some differences between both statements.

1. echo Statement
  • we can write echo statement with parenthesis like 'echo()' or without parenthesis 'echo'.
  • in the echo we can pass multiple variable in comma separated form to see the output like 'echo $a,$b,$c;'
  • echo doesn’t return any value
  • echo is faster then print
      Example:

      1.    <?php
                   echo "hello world";
                  // or
                  echo("hello world");
             ?>
      Output: hello world

      2.    <?php
                   $a = "Hi ";
                   $b = "this is ";
                   $c = "Ap here";
                   echo $a,$b,$c;
             ?>
      Output: Hi this is Ap here.

      3.    <?php
                   $a = "Raj";
                   $name = echo $a;             ?>
      Output: Parse error: syntax error, unexpected T_ECHO
    

2. Print Statement
  • we can write print statement with parenthesis like 'print()' or without parenthesis 'print'.
  • in the print we can not pass multiple variable in comma separated form like echo.
  • print statement always returns 1.
  • print is slower than echo
      Example:

      1.    <?php
                   print "hello world";
                  // or
                  print("hello world");
             ?>
      Output: hello world

      2.    <?php
                   $a = "Hi ";
                   $b = "this is ";
                   $c = "Ap here";
                   print $a,$b,$c;
             ?>
      Output: Parse error: syntax error

      3.    <?php
                   $a = "Raj";
                   $name = print $a;
                   echo $name;
             ?>
      Output: Raj
 
So, If you are having any query and doubt regarding this concept then you can ask in comments. 
Thank You !!!