From the codes below, i'm trying to show the details of the description that the user is going to click on.
<?php
include "login.php";
$query = "select * from news order by dates desc";
$result = mysql_query($query);
if(!$result)
{
die("Could not query the database: <br>" .mysql_error());
}
while($rowsql=mysql_fetch_array($result, MYSQL_ASSOC))
{
$link = $rowsql["news_details"];
echo $rowsql["dates"]. "<br>";
echo "<a href=show_news_details.php?$_POST[news_id] class='whiteNorm'>".$rowsql["news_desc"]."</a>";
echo "<br>";
}
mysql_close($connection);
?>
when the user click on one of the description, it will go to the below php to retrieve the details out. but there is a warning as
"warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in c:\wamp\www\bmc (halim's)\web\show_news_details.php on line 7"
can anyone help me please.
thanks in advance.
<?php
include "login.php";
$id = $_GET["news_id"];
$query = "select * from news where news_id = $id";
$result = mysql_query($query);
$answer = mysql_fetch_row($result);
echo $answer[2]." " .$answer[1]. "<br>". $answer[3];
?>