I'm afraid it still doesnt work... This is how I have my table set up
CREATE TABLE db_news (
news_id int(10) unsigned zerofill NOT NULL auto_increment
news_time int(20) NOT NULL default '0',
cat varchar(150) NOT NULL default '0',
user varchar(150) NOT NULL default '0',
title varchar(150) NOT NULL default '0',
news text,
PRIMARY KEY (news_id)
) TYPE=MyISAM;
The problem I think is somewhere in the sql query....:-/
edit-I've just added the 'news_id' table, and altered the function accordingly...
function displaynews() {
$limit=20;
$numresults=mysql_query("SELECT * FROM db_news WHERE 1 ORDER by news_time DESC");
$numrows=mysql_num_rows($numresults);
if (empty($offset)) {
$offset=1;
}
$result=mysql_query("select 'news_id' `news_time` , `cat` , `user` , `title` , `news` ".
"from db_news".
"order by news_time DESC limit $offset, $limit");
while ($data=mysql_fetch_array($result)) {
$htimed = date("m.d - Y", $data[news_time]);
echo "<table border=\"0\"><tr><td>
<center><h4><a href=\"index.php?run_control=show&cat=$data[cat]&news_time=$data[news_id]\">$data[title]</a></h4></td><td>.$htimed.</td></tr>" ;
echo "<tr><td colspan=\"2\">By: <b>.$data[user].</b></td></tr>";
echo "<tr><td colspan=\"2\">$data[news]</td></tr></table>";
}
}