Hi all 🙂 I’m back to coding since 10 years and I’ve some issues with sql queries:
I create the connection, which is right
$servername = "localhost";
$username = "myuser";
$password = "mypass";
$db = "dbname"
$conn = mysqli_connect($servername, $username, $password, $db);
Then the query:
$page = basename($_SERVER['PHP_SELF']);
$query = "select * from header_title where page_name = '".$page."'";
$result = mysqli_query($conn,$query);
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
if I try to echo
<?= $row['title'] ?>
nothing is shown 🙁
What I’m doing wrong?
Showing a results of mysqli_fetch_array
New contributor