Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to display sql database data in php

<?php
    $dbServername = "localhost";
    $dbUsername = "root";
    $dbPassword = "";
    $dbName = "dbname";
    
    $conn = mysqli_connect($dbServername, $dbUsername, $dbPassword, $dbName);
	
    $sql = "SELECT * FROM dbname;";
    $result = mysqli_query($conn, $sql);
    $resultCheck = mysqli_num_rows($result);

    if ($resultCheck > 0) {
      while ($row = mysqli_fetch_assoc($result)) {
        echo $row['sql_row_name'] . "<br>";
      }
    }
?>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #display #sql #database #data #php
ADD COMMENT
Topic
Name
9+1 =