Bootstrap FreeKB - PHP - SQL SELECT statement in PHP
PHP - SQL SELECT statement in PHP

Updated:   |  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 Buy Me A Coffee



Comments


Add a Comment


Please enter 408d69 in the box below so that we can be sure you are a human.