Code not echoing/displaying

Please can some one help me with this , the code i pasted below is not outputting my database.
There’s connection to the database but no output/echoing.

Here is the code :

<?php //connect database require "connect_to_mysqli.php"; //query the datbase $sqlcommand = "SELECT * From posts ORDER by id desc"; $query = mysqli_query($sqlCommand) or die (mysqli_error()); while($row = mysqli_fetch_array($query)) { $title = $row["title"]; } mysqli_free_result($query); //close connection mysqli_close($connect); ?>
  <?php echo "<h3>$title</h3>"; ?> 
  <h3>SIMPLE, LIGHT...LIKE THE POWERFUL SNEWS CMS</h3>

Thanks guy.

the query is $sqlcommand, but the while is trying to use $sqlCommand, capital c. php wise, there’s a huge difference, both are completely different varaibles to the script. Change it so that both are using the same varaible and it should work.

Sponsor our Newsletter | Privacy Policy | Terms of Service