When I run this I am getting no errors and no data back. What am I doing wrong?
Here is my code:
<?php
include 'connnectionmsql.php';
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
//Query
$sql = $conn->prepare("SELECT carid, carname FROM Cars WHERE carid = '1578'");
$sql->execute() ;
?>
<div id="contents">
<header>
<div id="top">
<div class="h2">
<?php while( $row = $sql->fetch()) : ?>
<h1><span><?php echo $row['carname']; ?></span>
<?php endwhile ?>