⊗dpPPBsMT 6 of 27 menu

Testing mysqli Database Connection on Hosting

Let's now test the connection to the database via the mysqli extension using the following test code:

<?php $host = ''; // host name $name = ''; // database name $user = ''; // username $pass = ''; // password $link = mysqli_connect($host, $user, $pass, $name); $query = 'SELECT * FROM users'; $res = mysqli_query($link, $query) or die(mysqli_error($link)); var_dump($res); ?>

Substitute your credentials into the test code, then upload this code to your site and test the connection to the database.

English
AfrikaansAzərbaycanБългарскиবাংলাБеларускаяČeštinaDanskDeutschΕλληνικάEspañolEestiSuomiFrançaisहिन्दीMagyarՀայերենIndonesiaItaliano日本語ქართულიҚазақ한국어КыргызчаLietuviųLatviešuМакедонскиMelayuမြန်မာNederlandsNorskPolskiPortuguêsRomânăРусскийසිංහලSlovenčinaSlovenščinaShqipСрпскиSrpskiSvenskaKiswahiliТоҷикӣไทยTürkmenTürkçeЎзбекOʻzbekTiếng Việt
We use cookies for website operation, analytics, and personalization. Data processing is carried out in accordance with the Privacy Policy.
accept all customize decline