⊗ppPmDBCM 362 of 447 menu

Finding Errors in the Database

As you already know, in PHP, error display is enabled using the error_reporting function. This function, however, does not enable the display of errors made in the SQL query text.

To output SQL command errors, you should use the mysqli_error function, which must be added to every database query, like this:

<?php $query = 'SELECT * FROM users'; $res = mysqli_query($link, $query) or die(mysqli_error($link)); ?>

For now, let's not delve into how this construct works. Just add it and, in case of an erroneous SQL query, you will see a message about it in the browser window.

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