How to connect to MySQL database using PHP

How to connect to MySQL database using PHP

To be able to connect to a MySQL database, you will need the following MySQL Database Connection Credentials:

  • Database Name
  • Host Name
  • User Name
  • Password

Before you can get content out of your MySQL database, you must know how to establish a connection to MySQL from inside a PHP script. To perform basic queries from within MySQL is very easy. This article will show you how to get up and running.

Let’s get started. The first thing to do is connect to the database.The function to connect to MySQL is called mysql_connect. This function returns a resource which is a pointer to the database connection. It’s also called a database handle, and we’ll use it in later functions. Don’t forget to replace your connection details.

$servername = "localhost";
$username = "username";
$password = "password";

// Create connection
$dbhandle = new mysqli($servername, $username, $password);

// Check connection
if ($dbhandle->connect_error) {
    die("Connection failed: " . $dbhandle->connect_error);
echo "Connected to MySQL successfully";

All going well, you should see “Connected to MySQL successfully” when you run this script. If you can’t connect to the server, make sure your password, username and hostname are correct.

How to remove shortcut virus on flash drive

How to remove shortcut virus on flash drive

If you did not format your flash drive, then check whether the files are not in hidden mode. Follow the following steps.

    • Click here download the file “AutorunExterminator

    • Extract it –> Double-click on “AutorunExterminator” –> Plug your flash drive now.
      This will remove the autorun.inf files from your flash drive and also from your drives.

    • Click on “Windows Key + R ”  type cmd and click on OK

      . CMD

    • Here I assume your flash drive letter as F: Enter this command.attrib -h -r -s /s /d f:\*.*


      You can copy the above command –> Right-click in the Command Prompt and paste it.

      Note : Don’t forget to replace the letter F with your flash drive letter. Now press “Enter”.
    • After that, download the Malwarebytes’ Anti-Malware from the below link
    • Update it –> Perform “Full Scan”
How to change the copyright ( footer) in Joomla

How to change the copyright ( footer) in Joomla

  1. Connect to your site via FTP
  2. Go to the core files >> Languages >> en-GB.mod_footer.ini || modify it there.
 FOOTER_LINE1=Copyright &#169; %date% %sitename%. All Rights Reserved.
 FOOTER_LINE2=<a href="">Joomla!</a> is Free Software released under the <a href="">GNU/GPL License.</a>
 THIS MODULE SHOWS THE JOOMLA! COPYRIGHT INFORMATION=This Module shows the Joomla! Copyright information