I am very new to this. I am trying to work through a tutorial, but cannot get the script to work.
I have a small database from which I want to extract headlines which have the status 'C'.
I cannot get the headlines to display. The code I am using is below. I inserted an echo statement so that I could see what was being actioned.
$query = @mysql_query("SELECT * FROM news WHERE news.status='C' ORDER BY headline asc");
$result = @mysql_query($query);
echo "Hello again";
while ($row = mysql_fetch_array($result)) {
echo "<a href=editnewsitem.php?id=".$row['id'].">" .$row['headline']."</a><br>";
}
As I understand it, $row will fetch each iincidence of the result of my query. In this case there should be 3 headlines returned.
I am sorry if this is very basic, but I cannot seem to get any output after the 'Hello again' echo.
Cheers
Harlequeen