PHP - SQL SELECT statement in PHP

by
Jeremy Canfield |
Updated: March 11 2020
| PHP articles
The following PHP code is used to select data from a MySQL table and to then display the data in a Web browser.
<?php
$con = new mysqli('ip_or_domain','username','password','database');
$select = "SELECT * FROM tablename";
$query = mysqli_query($con, $select);
while ($row = mysqli_fetch_array($query)) {
echo $row['columnname'];
}
?>
Did you find this article helpful?
If so, consider buying me a coffee over at