Hi guys
I'm trying to get this bit of code reading from my db.
It works fine on my localhost but on the server, which is running php in safe mode, it
only displays the following:
Could not retrieve records:
Could abybody help me out please?? I'm at my wits end with this.
<?php
$mysql = mysql_connect("localhost","anmluser","8uhb2wsx","anmldb");
if(!mysql){
printf("Connect failed: %s\n", mysql_error());
exit();
}else{
$sql = "SELECT homepage_id, page_title, page_content from tblhomepage WHERE homepage_id=4";
$res = mysql_query($mysql, $sql);
if($res){
//while($newArray = mysql_fetch_array($res, MYSQL_ASSOC)){
$title=$newArray['page_title'];
$content=$newArray['page_content'];
echo "<center>";
echo "<table border='0' cellpadding='6'>";
echo "<tr>";
echo "<td><font color='orange' size='3pt'><b>".$title."</b></font></td>";
echo "</tr>";
echo "<tr>";
echo "<td>".$content."</td>";
echo "</tr>";
echo "</table>";
echo "</center>";
//}
}else{
printf("Could not retrieve records: %s\n", mysql_error($mysql));
}
mysql_free_result($res);
mysql_close($mysql);
}
?>
Thanks in advance