Posted by:
bbcreative
(---.cable.ubr06.azte.blueyonder.co.uk)
Hi,
Thanks for your quick reply,
Yes, I am using <?php my code is below. It's the fact that the script works on a remote server/database but not locally that's confusing me.
<?php
$server = "localhost";
$username = "******";
$password = "******";
$link = mysql_connect ($server, $username, $password)
or die ("Could not connect"
;
echo "connected to database"; // I'm using this to make sure I'm connected to DB
if (!@mysql_select_db("ipic", $link)) {
echo "<p>There has been an error. This is the error message:</p>";
echo "<p><strong>" . mysql_error() . "</strong></p>";
echo "Please Contant Your Systems Administrator with the details";
}
$result = mysql_query("SELECT * FROM agenda", $link);
if (!$result) {
echo("<p>Error performing query: " . mysql_error() . "</p>"
;
exit();
}
$num=mysql_numrows($result);
$d=0;
while ($d < $num) {
$day=mysql_result($result,$d,"day"
;
$date=mysql_result($result,$d,"date"
;
$description=mysql_result($result,$d,"description"
;
?>
<table>
<tr>
<td bgcolor="#eeeeee"><? echo "$day"; ?></td>
<td bgcolor="#eeeeee"><? echo "$date"; ?></td>
<td align="center" bgcolor="#eeeeee"><? echo "$description"; ?></td>
</tr>
</table>
<?php
++$d;
}
mysql_close($link);
?>
Cheers