{"id":40978,"date":"2024-05-13T12:21:54","date_gmt":"2024-05-13T12:21:54","guid":{"rendered":"https:\/\/accuweb.cloud\/resource\/?post_type=faq&#038;p=40978"},"modified":"2026-02-19T05:45:41","modified_gmt":"2026-02-19T05:45:41","slug":"php-connection-to-mysql-mariadb","status":"publish","type":"faq","link":"https:\/\/accuweb.cloud\/resource\/articles\/php-connection-to-mysql-mariadb","title":{"rendered":"How To Connect A PHP Application With Mysql\/MariaDB\/Percona for PHP?"},"content":{"rendered":"<h2 class=\"ack-h2\">How To Connect A PHP Application With Mysql\/MariaDB\/Percona for PHP?<\/h2>\n<p>MySQL, <a class=\"ack-link-color\" href=\"https:\/\/accuweb.cloud\/database\/mariadb-hosting\" target=\"_blank\" rel=\"noopener\">MariaDB<\/a>, and Percona are very famous databases that anyone can use for free. Developers worldwide like to use them. Read the steps below to find out how to link your <a class=\"ack-link-color\" href=\"https:\/\/accuweb.cloud\/resource\/articles\/php-connection-to-mysql-mariadb\" target=\"_blank\" rel=\"noopener\">PHP program<\/a>, which is on the same platform, to one of these database servers (MySQL, MariaDB, and Percona).<\/p>\n<h2 class=\"ack-h2\" >Environment Creation<\/h2>\n<p><strong>Step 1.<\/strong>\u00a0Sign in to your<a class=\"ack-link-color\" href=\"https:\/\/accuweb.cloud\/resource\/articles\/deployment-hooks-overview\/\" target=\"_blank\" rel=\"noopener\"> AccuWeb.cloud<\/a> account and make a setup with either <strong>MySQL<\/strong> or <strong>MariaDB database<\/strong> server (both are options in the SQL wizard).<\/p>\n<p>We&#8217;ve included an Apache PHP Application Server to show how to connect.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-01.jpg\"><img fetchpriority=\"high\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41000 size-full\" title=\"PHP Application Server\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-01.jpg\" alt=\"PHP Application Server\" width=\"1224\" height=\"760\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-01.jpg 1224w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-01-300x186.jpg 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-01-1024x636.jpg 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-01-768x477.jpg 768w\" sizes=\"(max-width: 1224px) 100vw, 1224px\" \/><\/a><\/p>\n<p><strong>Step 2.<\/strong>\u00a0Once your setup is done, you&#8217;ll receive an email containing details for administering and connecting to MySQL (or <a class=\"ack-link-color\" href=\"https:\/\/accuweb.cloud\/database\/mariadb-hosting\" target=\"_blank\" rel=\"noopener\">MariaDB)<\/a>.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-02.png\"><img decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41037 size-full\" title=\"MySQL Node Created\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-02.png\" alt=\"MySQL Node Created\" width=\"905\" height=\"826\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-02.png 905w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-02-300x274.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-02-768x701.png 768w\" sizes=\"(max-width: 905px) 100vw, 905px\" \/><\/a><\/p>\n<p><strong>Step 3.<\/strong> Return to your account dashboard and click the <strong>&#8220;Open in Browser<\/strong>&#8221; button for the right database node (MySQL or MariaDB). Log in to the admin panel using the login details sent to you in the email.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-03.png\"><img decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41038 size-full\" title=\"Open in Browser\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-03.png\" alt=\"Open in Browser\" width=\"1306\" height=\"604\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-03.png 1306w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-03-300x139.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-03-1024x474.png 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-03-768x355.png 768w\" sizes=\"(max-width: 1306px) 100vw, 1306px\" \/><\/a><\/p>\n<p><strong>Step 4.<\/strong> Navigate to the <strong>&#8220;Databases&#8221;<\/strong> section and create a new database (like <strong>&#8220;accutest_db<\/strong>&#8220;).<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-04.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41039 size-full\" title=\"New Database Create\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-04.png\" alt=\"New Database Create\" width=\"1054\" height=\"688\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-04.png 1054w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-04-300x196.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-04-1024x668.png 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-04-768x501.png 768w\" sizes=\"(max-width: 1054px) 100vw, 1054px\" \/><\/a><\/p>\n<p><strong>Step 5 . <\/strong>Now, you&#8217;re set to deploy your application (either from an archive or a <strong>GIT\/SVN<\/strong> repository) to the setup you&#8217;ve created.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-05.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41041 size-full\" title=\"GIT\/SVN\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-05.png\" alt=\"GIT\/SVN\" width=\"1002\" height=\"499\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-05.png 1002w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-05-300x149.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-05-768x382.png 768w\" sizes=\"(max-width: 1002px) 100vw, 1002px\" \/><\/a><\/p>\n<h2 class=\"ack-h2\">Connecting to the Database<\/h2>\n<p>Once your project is set up, you&#8217;ll need to connect it to your database. You can do this by configuring your application properly, like using the built-in MySQLi extension.<\/p>\n<p>Check the official documentation page for all available functions. Here, we&#8217;ll cover the basics:<\/p>\n<div class=\"tooltip-container\">\n<div class=\"tooltip-text\">\nUse mysql or PDO to connect PHP with MySQL, MariaDB, or Percona. Validate credentials, use prepared statements to prevent SQL injection, and handle errors securely.<\/div>\n<div class=\"main-tooltip-btn\">\n<a class=\"tooltip-link\" href=\"https:\/\/accuweb.cloud\/application\/php-hosting\" target=\"_blank\" rel=\"noopener\"><button class=\"tooltip-btn\">PHP Hosting <svg class=\"tooltip-arrow\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 448 512\" style=\"width: 20px; height: 20px;\">\n        <path d=\"M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z\"><\/path>\n    <\/svg><\/button><\/a>\n<\/div>\n<\/div>\n<h3 class=\"ack-h3\">1. To Connect To Your Mysql\/MariaDB Node, Use This Function<\/h3>\n<ul class=\"ack-ul\">\n<li><strong>mysqli_connect(&#8216;{host}&#8217;<\/strong>, <strong>&#8216;{user}&#8217;<\/strong>, <strong>&#8216;{password}&#8217;<\/strong>, <strong>&#8216;{db_name}&#8217;);<\/strong>Replace the placeholders with your actual connection data:<\/li>\n<li><strong>{host}:<\/strong> the link to your DB node without the protocol part<\/li>\n<li><strong>{user}<\/strong> and <strong>{password}<\/strong>: your database admin credentials (for safety, it&#8217;s best to make a dedicated account with the right permissions)<\/li>\n<li><strong>{db_name}<\/strong>: the name of the database you want to use (like the one you created before)<\/li>\n<\/ul>\n<h3 class=\"ack-h3\">2. If You Need To Switch To A Different Database On The Same Server, Use This Function<\/h3>\n<div class=\"article-space\"><\/div>\n<pre><code class=\"language-javascript\">\r\nmysql_select_db('{connect}','{db_name}');<\/code><\/pre>\n<div class=\"article-space\"><\/div>\n<p>Replace <strong>{connect}<\/strong> with the connection string you got from the mysqli_connect function.<\/p>\n<h3 class=\"ack-h3\">3. To Close The Connection To Your Database, Use This Function<\/h3>\n<p>mysqli_close();<\/p>\n<p>Remember, you need to include these functions in every *.php page that needs to connect to the database.<\/p>\n<h2 class=\"ack-h2\">Checking Connection<\/h2>\n<p><strong>Step 1.<\/strong> Create a file with the name mysql-connection.php in your local system and paste the following PHP code.<\/p>\n<div class=\"article-space\"><\/div>\n<pre><code class=\"language-javascript\">\r\n&lt;?php\r\n$link = mysqli_connect('{host}', '{user}', '{password}', '{db_name}');\r\n\/\/ If connection fails, you'll see an error message\r\nif (!$link) {\r\ndie('Could not connect: ' . mysql_error());\r\n}\r\n\/\/ If connection is successful, you'll see this message\r\necho 'Connected successfully';\r\nmysqli_close($link);\r\n?&gt;<\/code><\/pre>\n<div class=\"article-space\"><\/div>\n<p>Remember to replace {host}, {user}, {password}, and {db_name} with the actual values you got from the Connection to Database section.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-06.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41044 size-full\" title=\"Connection to Database section\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-06.png\" alt=\"Connection to Database section\" width=\"863\" height=\"376\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-06.png 863w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-06-300x131.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-06-768x335.png 768w\" sizes=\"(max-width: 863px) 100vw, 863px\" \/><\/a><\/p>\n<p><strong>Step 2.<\/strong> Go to the <a class=\"ack-link-color\" href=\"https:\/\/accuweb.cloud\/\" target=\"_blank\" rel=\"noopener\">AccuWeb.Cloud<\/a> dashboard and choose the environment where you want to check the database connection.<\/p>\n<p><strong>Step 3.<\/strong> Select the Application Server and the Node server. Then click on <strong>Config<\/strong> next to the Node server.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-07.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41046 size-full\" title=\"Application Server\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-07.png\" alt=\"Application Server\" width=\"1029\" height=\"600\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-07.png 1029w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-07-300x175.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-07-1024x597.png 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-07-768x448.png 768w\" sizes=\"(max-width: 1029px) 100vw, 1029px\" \/><\/a><\/p>\n<p><strong>Step 4.<\/strong> Navigate to the Apache document path <strong>(\/var\/www\/webroot\/ROOT).<\/strong><\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-08.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41048 size-full\" title=\"Navigate Root Document\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-08.png\" alt=\"Navigate Root Document\" width=\"1002\" height=\"656\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-08.png 1002w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-08-300x196.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-08-768x503.png 768w\" sizes=\"(max-width: 1002px) 100vw, 1002px\" \/><\/a><\/p>\n<p><strong>Step 5. <\/strong>Then click on the <strong>Settings icon<\/strong> and choose <strong>Upload.<\/strong><\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41050 size-full\" title=\"Choose Upload Docs\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-10.png\" alt=\"Choose Upload Docs\" width=\"1003\" height=\"668\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-10.png 1003w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-10-300x200.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-10-768x511.png 768w\" sizes=\"(max-width: 1003px) 100vw, 1003px\" \/><\/a><\/p>\n<p><strong>Step 5.<\/strong> In the Upload Files window, go to Local Files and select the file from your computer. Click <strong>Upload<\/strong> to add the file to the AccuWeb.Cloud environment.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-11.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41052 size-full\" title=\" Local Upload Files\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-11.png\" alt=\" Local Upload Files\" width=\"998\" height=\"679\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-11.png 998w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-11-300x204.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-11-768x523.png 768w\" sizes=\"(max-width: 998px) 100vw, 998px\" \/><\/a><\/p>\n<p><strong>Step 6.<\/strong> Once the file is uploaded, you can see the file in the <strong>Apache document path.<\/strong><\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-12.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41054 size-full\" title=\"Apache Document Path\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-12.png\" alt=\"Apache Document Path\" width=\"997\" height=\"691\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-12.png 997w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-12-300x208.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-12-768x532.png 768w\" sizes=\"(max-width: 997px) 100vw, 997px\" \/><\/a><\/p>\n<p><strong>Step 7.<\/strong> Click <strong>Open in Browser<\/strong> to load the Apache default page or PHP site. Then, add the file name at the end of the page.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-13.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41055 size-full\" title=\"Open in Browser\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-13.png\" alt=\"Open in Browser\" width=\"1025\" height=\"632\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-13.png 1025w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-13-300x185.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-13-768x474.png 768w\" sizes=\"(max-width: 1025px) 100vw, 1025px\" \/><\/a><\/p>\n<p>If everything&#8217;s fine, you&#8217;ll see the <strong>&#8220;Connected successfully&#8221;<\/strong> message when you open this page in your browser.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-14.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41056 size-full\" title=\"Connected Successfully\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-14.png\" alt=\"Connected Successfully\" width=\"995\" height=\"312\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-14.png 995w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-14-300x94.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-14-768x241.png 768w\" sizes=\"(max-width: 995px) 100vw, 995px\" \/><\/a><\/p>\n<h2 class=\"ack-h2\">Running a Simple Query<\/h2>\n<p>Here&#8217;s an example of how to run a basic query on your database and display the results in a table.<\/p>\n<div class=\"tooltip-container\">\n<div class=\"tooltip-text\">\nWhen connecting a PHP application to MySQL, MariaDB, or Percona, always validate your database credentials and use secure connections (SSL) if available. Use prepared statements or parameterized queries to prevent SQL injection. Test the connection in a development environment before moving to production.<\/div>\n<div class=\"main-tooltip-btn\">\n<a class=\"tooltip-link\" href=\"https:\/\/accuweb.cloud\/database\/mysql-hosting\" target=\"_blank\" rel=\"noopener\"><button class=\"tooltip-btn\">MySQL Hosting <svg class=\"tooltip-arrow\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 448 512\" style=\"width: 20px; height: 20px;\">\n        <path d=\"M438.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L338.8 224 32 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l306.7 0L233.4 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z\"><\/path>\n    <\/svg><\/button><\/a>\n<\/div>\n<\/div>\n<p>This PHP script will connect to your database server (make sure to use the correct hostname and credentials), switch to the default MySQL database, fetch values from the help_topic table, and show them in a table.<\/p>\n<p><strong>Step 1.<\/strong> Create a file with the name <strong>view-data.php<\/strong> in your local system and paste the following PHP code.<\/p>\n<div class=\"article-space\"><\/div>\n<pre><code class=\"language-javascript\">\r\n&lt;?php\r\n\/\/ Check connection:\r\n$link = mysqli_connect('{host}', '{user}', '{password}', '{db_name}');\r\nif (!$link)\r\n{\r\necho \"&lt;h2&gt;MySQL Error!&lt;\/h2&gt;\";\r\nexit;\r\n}\r\n\/\/ Switch to a different database:\r\n$db=\"mysql\";\r\nmysqli_select_db($link, $db);\r\n\/\/ Table header:\r\necho \"&lt;table border=\\\"1\\\" width=\\\"100%\\\" bgcolor=\\\"#FFFFE1\\\"&gt;\";\r\necho \"&lt;tr&gt;&lt;td&gt;Value1&lt;\/td&gt;&lt;td&gt;Value2&lt;\/td&gt;&lt;td&gt;Value3&lt;\/td&gt;\";\r\n\/\/ SQL query:\r\n$q = mysqli_query ($link, \"SELECT * FROM help_topic;\");\r\n\/\/ Output the table result:\r\nfor ($c=0; $c&lt;mysqli_num_rows($q); $c++)\r\n{\r\necho \"&lt;tr&gt;\";\r\n$f = mysqli_fetch_array($q);\r\necho \"&lt;td&gt;$f[0]&lt;\/td&gt;&lt;td&gt;$f[1]&lt;\/td&gt;&lt;td&gt;$f[5]&lt;\/td&gt;\";\r\necho \"&lt;\/tr&gt;\";\r\n}\r\necho \"&lt;\/table&gt;\";\r\n?&gt;<\/code><\/pre>\n<div class=\"article-extra-space\"><\/div>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-15.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41058 size-full\" title=\"view-data php file\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-15.png\" alt=\"view-data php file\" width=\"858\" height=\"658\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-15.png 858w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-15-300x230.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-15-768x589.png 768w\" sizes=\"(max-width: 858px) 100vw, 858px\" \/><\/a><\/p>\n<p><strong>Step 2.<\/strong> Go to the <a class=\"ack-link-color\" href=\"https:\/\/accuweb.cloud\/\" target=\"_blank\" rel=\"noopener\">AccuWeb.Cloud<\/a> dashboard and choose the environment where you want to check the database connection.<\/p>\n<p><strong>Step 3:<\/strong> Pick the Application Server, then select the Node server. Click on <strong>Config<\/strong> next to the Node server.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-16.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41059 size-full\" title=\"Config next to the Node server.\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-16.png\" alt=\"Config next to the Node server.\" width=\"1029\" height=\"600\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-16.png 1029w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-16-300x175.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-16-1024x597.png 1024w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-16-768x448.png 768w\" sizes=\"(max-width: 1029px) 100vw, 1029px\" \/><\/a><\/p>\n<p><strong>Step 4.<\/strong> Navigate to the Apache document path <strong>(\/var\/www\/webroot\/ROOT).<\/strong> Then click on the <strong>Settings<\/strong> icon and choose <strong>Upload.<\/strong><\/p>\n<p><strong>Step 5.<\/strong> In the Upload Files Window, go to Local Files and select the file from your computer. Click <strong>Upload<\/strong> to add the file to the <a class=\"ack-link-color\" href=\"https:\/\/accuweb.cloud\/\" target=\"_blank\" rel=\"noopener\">AccuWeb.Cloud<\/a> environment.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-17.png\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41061 size-full\" title=\"Upload Files Window\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-17.png\" alt=\"Upload Files Window\" width=\"1003\" height=\"676\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-17.png 1003w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-17-300x202.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-17-768x518.png 768w\" sizes=\"(max-width: 1003px) 100vw, 1003px\" \/><\/a><\/p>\n<p><strong>Step 6.<\/strong> After you upload the file, you&#8217;ll be able to find it in the <strong>Apache document path.<\/strong><\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-18.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-41062\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-18.png\" alt=\"\" width=\"1000\" height=\"672\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-18.png 1000w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-18-300x202.png 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-18-768x516.png 768w\" sizes=\"(max-width: 1000px) 100vw, 1000px\" \/><\/a><\/p>\n<p><strong>Step 7.<\/strong> Click <strong>Open in Browser<\/strong> to load the Apache default page or PHP site. Then add the file name at the end of the page.<\/p>\n<p>This will give you an index of all available <a class=\"ack-link-color\" href=\"https:\/\/accuweb.cloud\/database\/mysql-hosting\" target=\"_blank\" rel=\"noopener\">MySQL<\/a> functions with links to instructions on how to use them.<\/p>\n<p><a href=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-19.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"ack-article-image aligncenter wp-image-41063 size-full\" title=\"index of all available MySQL functions\" src=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-19.jpg\" alt=\"index of all available MySQL functions\" width=\"987\" height=\"908\" srcset=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-19.jpg 987w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-19-300x276.jpg 300w, https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/05\/PHP-application-server-19-768x707.jpg 768w\" sizes=\"(max-width: 987px) 100vw, 987px\" \/><\/a><\/p>\n<p>Now, you can easily connect your PHP application to a MySQL or MariaDB database.<\/p>\n<h2 class=\"ack-h2\">Conclusion<\/h2>\n<p>In summary, connecting your PHP app to <a class=\"ack-link-color\" ref=\"https:\/\/accuweb.cloud\/database\/mysql-hosting\" target=\"_blank\" rel=\"noopener\">MySQL<\/a>\/MariaDB\/Percona is crucial to working with databases in your web app. You can do this by creating a connection file with the right info and uploading it to your hosting.<\/p>\n<p>Remember to replace placeholders with actual database details to ensure a successful connection. Once connected, you can easily manage data in your database, like retrieving, adding, updating, and deleting, to add dynamic features to your PHP app.<\/p>\n<div class=\"cta-btn-top-space\"><\/div>\n\t\t<div data-elementor-type=\"section\" data-elementor-id=\"38668\" class=\"elementor elementor-38668\" data-elementor-settings=\"{&quot;ha_cmc_init_switcher&quot;:&quot;no&quot;}\" data-elementor-post-type=\"elementor_library\">\n\t\t\t        <section class=\"elementor-section elementor-top-section elementor-element elementor-element-882321f elementor-section-boxed elementor-section-height-default elementor-section-height-default ct-header-fixed-none ct-row-max-none\" data-id=\"882321f\" data-element_type=\"section\" data-settings=\"{&quot;_ha_eqh_enable&quot;:false}\">\n            \n                        <div class=\"elementor-container elementor-column-gap-default \">\n                    <div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7cc79cc\" data-id=\"7cc79cc\" data-element_type=\"column\">\n        <div class=\"elementor-widget-wrap elementor-element-populated\">\n                    \n        \t\t<div class=\"elementor-element elementor-element-e31b40f elementor-widget elementor-widget-shortcode\" data-id=\"e31b40f\" data-element_type=\"widget\" data-widget_type=\"shortcode.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-shortcode\"><\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t            <\/div>\n        <\/div>\n                    <\/div>\n        <\/section>\n        \t\t<\/div>\n\t\t\n<div class=\"cta-btn-bottom-space\"><\/div>\n","protected":false},"author":1,"featured_media":52879,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","class_list":["post-40978","faq","type-faq","status-publish","has-post-thumbnail","hentry","faq_topics-connection-to-application","faq_topics-databases","faq_topics-kb","faq_topics-mysql-mariadb-percona","faq_topics-php-connection","faq_topics-product-documentation"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v20.10 (Yoast SEO v24.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Connect PHP to MySQL and MariaDB | AccuWeb.Cloud guide<\/title>\n<meta name=\"description\" content=\"Connect your PHP to powerful databases without breaking the bank - this guide shows you how to link to MySQL, MariaDB, and Percona for free\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Connect A PHP Application With Mysql\/MariaDB\/Percona for PHP?\" \/>\n<meta property=\"og:description\" content=\"Connect your PHP to powerful databases without breaking the bank - this guide shows you how to link to MySQL, MariaDB, and Percona for free\" \/>\n<meta property=\"og:url\" content=\"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb\" \/>\n<meta property=\"og:site_name\" content=\"AccuWeb Cloud\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-19T05:45:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb#article\",\"isPartOf\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/php-connection-to-mysql-mariadb\"},\"author\":{\"name\":\"Jilesh Patadiya\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/#\/schema\/person\/a7a4cbe8405202b537509c757b588c58\"},\"headline\":\"How To Connect A PHP Application With Mysql\/MariaDB\/Percona for PHP?\",\"datePublished\":\"2024-05-13T12:21:54+00:00\",\"dateModified\":\"2026-02-19T05:45:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/php-connection-to-mysql-mariadb\"},\"wordCount\":974,\"publisher\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/#organization\"},\"image\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb#primaryimage\"},\"thumbnailUrl\":\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg\",\"inLanguage\":\"en-US\"},{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/php-connection-to-mysql-mariadb\",\"url\":\"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb\",\"name\":\"Connect PHP to MySQL and MariaDB | AccuWeb.Cloud guide\",\"isPartOf\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb#primaryimage\"},\"image\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb#primaryimage\"},\"thumbnailUrl\":\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg\",\"datePublished\":\"2024-05-13T12:21:54+00:00\",\"dateModified\":\"2026-02-19T05:45:41+00:00\",\"description\":\"Connect your PHP to powerful databases without breaking the bank - this guide shows you how to link to MySQL, MariaDB, and Percona for free\",\"breadcrumb\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb#primaryimage\",\"url\":\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg\",\"contentUrl\":\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/accuweb.cloud\/resource\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Connect A PHP Application With Mysql\/MariaDB\/Percona for PHP?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/#website\",\"url\":\"https:\/\/accuweb.cloud\/resource\/\",\"name\":\"AccuWeb Cloud\",\"description\":\"Cutting Edge Cloud Computing\",\"publisher\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/accuweb.cloud\/resource\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/#organization\",\"name\":\"AccuWeb.Cloud\",\"url\":\"https:\/\/accuweb.cloud\/resource\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/04\/accuwebcloud_logo_black_tagline.jpg\",\"contentUrl\":\"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/04\/accuwebcloud_logo_black_tagline.jpg\",\"width\":156,\"height\":87,\"caption\":\"AccuWeb.Cloud\"},\"image\":{\"@id\":\"https:\/\/accuweb.cloud\/resource\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/#\/schema\/person\/a7a4cbe8405202b537509c757b588c58\",\"name\":\"Jilesh Patadiya\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/accuweb.cloud\/resource\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2cea2bdb5bbabb771ee67e96acad7396f25cb1a0c360b9bc4a9ac40cea9cd8b2?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2cea2bdb5bbabb771ee67e96acad7396f25cb1a0c360b9bc4a9ac40cea9cd8b2?s=96&d=mm&r=g\",\"caption\":\"Jilesh Patadiya\"},\"description\":\"Jilesh Patadiya, the visionary Co-Founder and Chief Technology Officer (CTO) behind AccuWeb.Cloud. Founder &amp; CTO at AccuWebHosting.com. He shares his web hosting insights on the AccuWeb.Cloud blog. He mostly writes on the latest web hosting trends, WordPress, storage technologies, and Windows and Linux hosting platforms.\",\"sameAs\":[\"https:\/\/accuweb.cloud\/resource\",\"https:\/\/www.facebook.com\/accuwebhosting\",\"https:\/\/www.instagram.com\/accuwebhosting\/\",\"https:\/\/www.linkedin.com\/company\/accuwebhosting\/\",\"https:\/\/x.com\/accuwebhosting\",\"https:\/\/www.youtube.com\/c\/Accuwebhosting\"],\"url\":\"https:\/\/accuweb.cloud\/resource\/author\/accuwebadmin\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Connect PHP to MySQL and MariaDB | AccuWeb.Cloud guide","description":"Connect your PHP to powerful databases without breaking the bank - this guide shows you how to link to MySQL, MariaDB, and Percona for free","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb","og_locale":"en_US","og_type":"article","og_title":"How To Connect A PHP Application With Mysql\/MariaDB\/Percona for PHP?","og_description":"Connect your PHP to powerful databases without breaking the bank - this guide shows you how to link to MySQL, MariaDB, and Percona for free","og_url":"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb","og_site_name":"AccuWeb Cloud","article_modified_time":"2026-02-19T05:45:41+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb#article","isPartOf":{"@id":"https:\/\/accuweb.cloud\/resource\/articles\/php-connection-to-mysql-mariadb"},"author":{"name":"Jilesh Patadiya","@id":"https:\/\/accuweb.cloud\/resource\/#\/schema\/person\/a7a4cbe8405202b537509c757b588c58"},"headline":"How To Connect A PHP Application With Mysql\/MariaDB\/Percona for PHP?","datePublished":"2024-05-13T12:21:54+00:00","dateModified":"2026-02-19T05:45:41+00:00","mainEntityOfPage":{"@id":"https:\/\/accuweb.cloud\/resource\/articles\/php-connection-to-mysql-mariadb"},"wordCount":974,"publisher":{"@id":"https:\/\/accuweb.cloud\/resource\/#organization"},"image":{"@id":"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb#primaryimage"},"thumbnailUrl":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg","inLanguage":"en-US"},{"@type":["WebPage","FAQPage"],"@id":"https:\/\/accuweb.cloud\/resource\/articles\/php-connection-to-mysql-mariadb","url":"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb","name":"Connect PHP to MySQL and MariaDB | AccuWeb.Cloud guide","isPartOf":{"@id":"https:\/\/accuweb.cloud\/resource\/#website"},"primaryImageOfPage":{"@id":"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb#primaryimage"},"image":{"@id":"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb#primaryimage"},"thumbnailUrl":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg","datePublished":"2024-05-13T12:21:54+00:00","dateModified":"2026-02-19T05:45:41+00:00","description":"Connect your PHP to powerful databases without breaking the bank - this guide shows you how to link to MySQL, MariaDB, and Percona for free","breadcrumb":{"@id":"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb#primaryimage","url":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg","contentUrl":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/07\/NEW-OG-IMAGE-URL.jpg","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/accuweb.cloud\/resource\/articles\/PHP-connection-to-mysql-mariadb#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/accuweb.cloud\/resource\/"},{"@type":"ListItem","position":2,"name":"How To Connect A PHP Application With Mysql\/MariaDB\/Percona for PHP?"}]},{"@type":"WebSite","@id":"https:\/\/accuweb.cloud\/resource\/#website","url":"https:\/\/accuweb.cloud\/resource\/","name":"AccuWeb Cloud","description":"Cutting Edge Cloud Computing","publisher":{"@id":"https:\/\/accuweb.cloud\/resource\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/accuweb.cloud\/resource\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/accuweb.cloud\/resource\/#organization","name":"AccuWeb.Cloud","url":"https:\/\/accuweb.cloud\/resource\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/accuweb.cloud\/resource\/#\/schema\/logo\/image\/","url":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/04\/accuwebcloud_logo_black_tagline.jpg","contentUrl":"https:\/\/accuweb.cloud\/resource\/wp-content\/uploads\/2024\/04\/accuwebcloud_logo_black_tagline.jpg","width":156,"height":87,"caption":"AccuWeb.Cloud"},"image":{"@id":"https:\/\/accuweb.cloud\/resource\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/accuweb.cloud\/resource\/#\/schema\/person\/a7a4cbe8405202b537509c757b588c58","name":"Jilesh Patadiya","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/accuweb.cloud\/resource\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2cea2bdb5bbabb771ee67e96acad7396f25cb1a0c360b9bc4a9ac40cea9cd8b2?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2cea2bdb5bbabb771ee67e96acad7396f25cb1a0c360b9bc4a9ac40cea9cd8b2?s=96&d=mm&r=g","caption":"Jilesh Patadiya"},"description":"Jilesh Patadiya, the visionary Co-Founder and Chief Technology Officer (CTO) behind AccuWeb.Cloud. Founder &amp; CTO at AccuWebHosting.com. He shares his web hosting insights on the AccuWeb.Cloud blog. He mostly writes on the latest web hosting trends, WordPress, storage technologies, and Windows and Linux hosting platforms.","sameAs":["https:\/\/accuweb.cloud\/resource","https:\/\/www.facebook.com\/accuwebhosting","https:\/\/www.instagram.com\/accuwebhosting\/","https:\/\/www.linkedin.com\/company\/accuwebhosting\/","https:\/\/x.com\/accuwebhosting","https:\/\/www.youtube.com\/c\/Accuwebhosting"],"url":"https:\/\/accuweb.cloud\/resource\/author\/accuwebadmin"}]}},"_links":{"self":[{"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/faq\/40978","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/faq"}],"about":[{"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/types\/faq"}],"author":[{"embeddable":true,"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/comments?post=40978"}],"version-history":[{"count":15,"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/faq\/40978\/revisions"}],"predecessor-version":[{"id":53265,"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/faq\/40978\/revisions\/53265"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/media\/52879"}],"wp:attachment":[{"href":"https:\/\/accuweb.cloud\/resource\/wp-json\/wp\/v2\/media?parent=40978"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}