Hi all.
I'm trying to get the contents of a MySQL table to display on a web page and have so far got nothing 🙁
In the table, there is just 1 field which is Text and Not Null. Here is the code I am using:
<html>
<head>
<style type="text/css">
<!--
A:link { text-decoration: none;}
A:visited { text-decoration: none;}
A:hover { text-decoration: underline;}
-->
</style>
<title>Staff</title>
</head>
<body bgcolor="#9933FF" link="#FF3399" vlink="#FF3399" alink="#FF3399">
</body></html>
<?php
$dbhost = 'localhost';
$dbusername = '***';
$dbuserpassword = '***';
$default_dbname = '***';
$db=mysql_connect($dbhost,$dbusername,$dbuserpassword);
mysql_select_db("sleyland");
$query = 'SELECT message FROM staff LIMIT 0, 30';
$result = mysql_query($query);
$message = nl2br($query_data[0]);
echo "<center><table border='1' bordercolor=Black width=100%><tr bgcolor='FF3399'><td>";
echo "<font face='Arial' size='2' color='#FFFFFF'>Staff Info</font></td></tr><tr><td bgcolor='#FFFFFF'><font face='Arial' size='2'
color='#000000'>$message</font></td></tr></table><br><font color='FFFFFF'></font></center>";
?>
I'm sure it's a really silly mistake but I can't see it.
Thanks for any help