PHP קוד:
<?php
mysql_connect('localhost','example_domain','112211');
mysql_select_db('example_domain');
$result = mysql_query("SELECT * FROM news ORDER BY id DESC") or die(mysql_error());
if (isset($_GET["id"])) {
/* Build an article query */
$q = mysql_query("SELECT * FROM news WHERE id='{$_GET['id']}'");
while ($row = mysql_fetch_row($q)) {
$content = $row["content"];
$title = $row["title"];
echo "abc";
}
} else {
while ($row=mysql_fetch_array($result))
{
echo ("<table width=\"600\" cellpadding=\"2\" cellspacing=\"2\" border=\"1\"> ");
echo ("<tr> ");
echo ("<td bgcolor=\"gray\" width=\"100%\">" . $row['title'] . "</td> ");
echo ("</tr> ");
echo ("<tr><td bgcolor=\"white\" width=\"100%\">" . $row['subject'] . "</td> ");
echo ("</tr> ");
echo ("<tr><td bgcolor=\"white\" width=\"100%\">" . $row['content'] . "</td> ");
echo ("</tr> ");
echo ("<tr><td bgcolor=\"white\" width=\"100%\">" . $row['date'] . "</td> ");
echo ("</tr> ");
echo ("</table> ");
echo ("<br>");
}
}
?>
אני לא ראיתי פה קבוע, MYSQL_BOTH , כנראה זאת הבעיה.
נסה.