Hey, genuises and nerds, got a easy question for ya:
I have a little table in a little mySQL DB called Items. In this table I have the columns Date, Filename, Description, and Creator (and an id column auto_inc'ed ).
What I wanna do is display a simple table in which you can see the rows of the database. Here's what I have so far:
<html>
<head><title>Test DB Access page</title>
</head>
<body>
<table>
<tr>
<th>Date:</th>
<th>Name:</th>
<th>Description:</th>
<th>Creator</th>
</tr>
<?php
mysql_connect("localhost", "arenium", "xXxXXXXXX");
mysql_select_db("arenium_customs");
$query = "SELECT * FROM Items SORT BY id DESC";
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){
echo "<tr>";
echo "<td> {$row['Date']} </td>";
echo "<td><a href=\"{$row['Filename']}\">{$row['Name']}</a></td>";
echo "<td> {$row['Description']} </td>";
echo "<td> {$row['Creator']} </td>";
echo "</tr>";
}
?>
</body>
</html>
As you can see, I also want a link to be made out of two entries (filename and name); if i did it right, hoorah, if not, fix it for me PLZ.
However, the biggest problem is, when I go to my page, I get the error: "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/arenium/public_html/test.php on line 21"
These means nothing to me and any help would be greatly appreciated.