Background:
The page "news.php" kan have the following functionality:
1. news.php
outputs a general "this is the newspage"-text (left column) and lists the 5 latest news (in the right column)
2. news.php?action=archive
lists alla news i database (left column)
and 5 latest (in right column)
3. news.php?action=item&newsID=n
shows single news (bases on newsID) and 5 latest news i right column.
Depending on which URL-string news.php gets, a different function gets executed.
I know that the function (and the URL-stringJ works, since I did a simple
test with "echo"-strings. However, when I add the code below, the page
will not render properly.
Code:
$sql_all = "SELECT * FROM nyheter ORDER BY datum DESC";
$result_all = mysql_query($sql_all, $gunther) or die(mysql_error());
$row_all = mysql_fetch_assoc($result_all);
I have used the same code on another page (i.e. i had separate pages for viewing the archive and viewing a single news, until I realized that I could pack the same functionallity into "news.php" and use URL-strings)
But... the SQL query stops the page rendering...
I know that the IF statements works.
I know that the decoding of URL-strings works.
I know that the SQL Query is correct and delivers the correct result after having tested it via phpMyAdmin.
Any ideas?