I am trying to print out the "branch" table from one of my mysql databases, that is named dreamhome. This is the code I have so far, could you tell me what I need to put inside of my php file so that it prints out queries from this database without the error I am getting?
I've already successfully connected and I have tried saving the query into a string and then using the my sql query function to query the database.
<?php
$servername = "localhost";
$username = "root";
$password = "";
$conn = new mysqli($servername, $username, $password);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
echo "Connected successfully";
$query = "SELECT * FROM branch";
$result = mysql_query($query);
while ($value = mysql_fetch_array($result)){
echo $value ('street');
}
?>
Below contains the error that I am getting.
Fatal error: Uncaught Error: Call to undefined function mysql_query() in C:\xampp\htdocs\myprojectweb\index.php:16 Stack trace: #0 {main} thrown in C:\xampp\htdocs\myprojectweb\index.php on line 16