0

so, im editing my site and i made a blog, it worked earlier but idk why its not working now. it may be something small that im just over looking but my table of entries come up empty when i know my mysql server has 1 entry in that table. im using easyphp for development. here is the code.

<?php
$con=mysqli_connect("localhost","root","","admin");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

include "menu.php";

?>
<center>
<table border="1" width = "1250px" style="height:500px;color:white;" bordercolor="red">
<tr>
<td style="color:white;text-align:left;vertical-align:top;background-color:black;background: rgba(0, 0, 0, 0.3);">

<table>
<tr>
<td style='color:white;'><b>BLOG ENTRIES</b></td>
</tr>

<?php
$result = mysqli_query($con,"SELECT * FROM blog_list");

if($result == FALSE) 
{
    die(mysql_error());
}

if(!$row = mysqli_fetch_array($result))
{
    echo "<tr><td style='color:white;'>The blog is currently empty.</td></tr>";
}
else
{
    while($row = mysqli_fetch_array($result))
    {
        echo "<tr>";
        echo "<td>" . $row['title'] . "</td>";
        echo "<td>" . $row['body'] . "<br><font size=-2>Submited by " . $row['submitor'] . ": Dated " . $row['submition'] . "</font></td>";
        echo "</tr>";
    }
}

?>

</table>
</td>
<td width = "280px" style="background-color:black;background: rgba(0, 0, 0, 0.3);">
<?php

include "sidebar.php";

?>
</td>
</tr>
</table>
3
Contributors
3
Replies
29
Views
4 Years
Discussion Span
Last Post by EvolutionFallen
0

In the begning of your page add 2 lines, It will show error if any

error_reporting(E_ALL); 
ini_set("display_errors", 1); 
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.