Hi there. I have been experiencing problems with my first php page I have created.
When loading the page I do not get any error messages and the query results do not display, it will not even display any html after the query has run.
I thought it was just my webserver setup on my machine at home so to test my theory I added by scripts to my hosts webserver and was dismayed to find that I am still having the same problems. (yet pleased that it wasn't just my poor configuration skills on my home machine)
It is connecting to the database fine and executing the query ok (as I do get errors displayed when this has failed previously and I have manually run the query in command prompt... pretty sure its not the sql elements). When I load the page it is not displaying the table of results or the paragrah telling me something is wrong. All of my includes are working fine but as yet contain no dynamic content.
<body>
<?php error_reporting (E_ALL);?>
<?php include "leftnav.php";?>
<?php include "topnav.php";?>
<?php include "footer.php";?>
<div id="Layer4" style="position:absolute; left:170px; top:169px; width:850px; height:594px">
<! here is this bit you fill in!>
<?php
require_once ('mysql_connect.php');
$sql = 'SELECT `title`,`author`,`subdate`,`text` FROM `sitec` WHERE `category` =\'Articles\' ORDER BY `subdate`';
$result= mysql_query($sql)OR
die (mysql_error());
if ($result) {
echo '<table><tr><td> Title</td><td>Author</td><td>Articles</td></tr>';
while ($row=mysql_fetch_array($result)){
echo '<tr><td> '. $row['title'] .' </td><td> '. $row['author'] .' </td><td> '.$row['text'] .'</td></tr>';}
echo '</table>';
}else{
echo '<p> The current query did not execute successfully</p>';
echo '<p>' .mysql_error() . '<br />
<br /> Query: '. $query .' </p>';}
mysql_close();
?>
<!end of main content!>
</body>
</html>
Any suggestions greatfully received.
Regards