MOST_READ : front end code to add
- lady_witchcraft
- Posts: 94
- Joined: Sun 14. Nov 2004, 19:19
- Location: Austria
- Contact:
no chance to get "most read articles" work - HELP
2nd post 'cause i can't get the most read articles count working - only thing that has changed - no more error messages occure with putting the code in the frontend_render folder as brans suggested !
main prob is that the code doesn`t create any db records in the new table (created following an older thread: CREATE TABLE `phpwcms_article_read_count` (
`date_read` datetime NOT NULL default '0000-00-00 00:00:00',
`article_id` int(11) NOT NULL default '0',
`cat_id` int(11) NOT NULL default '0',
PRIMARY KEY (`date_read`)
) TYPE=MyISAM; )
And why the hell are no written infos in the table ??? any suggestions? please guys help me!!! thx in advance!
main prob is that the code doesn`t create any db records in the new table (created following an older thread: CREATE TABLE `phpwcms_article_read_count` (
`date_read` datetime NOT NULL default '0000-00-00 00:00:00',
`article_id` int(11) NOT NULL default '0',
`cat_id` int(11) NOT NULL default '0',
PRIMARY KEY (`date_read`)
) TYPE=MyISAM; )
And why the hell are no written infos in the table ??? any suggestions? please guys help me!!! thx in advance!
... it's not bad luck, it's a bug ...
it doesnt work
sorry, I did exactly what did you write here. I have a 1.2 dev version. And this tag after implementation doesnt work
many thanks Snezko
- marcus@localhorst
- Posts: 815
- Joined: Fri 28. May 2004, 11:31
- Location: localhorst
- Contact:
hi i found out the tableprepend variable doesn't work
i just remove the DB_PREPEND and write my real tablename in the sql and it work.
strange
Code: Select all
FROM ".DB_PREPEND."article_read_count
Code: Select all
FROM phpwcms_article_read_count
- lady_witchcraft
- Posts: 94
- Joined: Sun 14. Nov 2004, 19:19
- Location: Austria
- Contact:
still no records in DB
hy marcus,
thx for your suggestion, tried it but still got the same problem, no records are listet in the table tried a lot of things, but i really got no idea why the most_read function doesn`t works and the code doesn`t creats any records!?
greets from vienna
thx for your suggestion, tried it but still got the same problem, no records are listet in the table tried a lot of things, but i really got no idea why the most_read function doesn`t works and the code doesn`t creats any records!?
greets from vienna
... it's not bad luck, it's a bug ...
- marcus@localhorst
- Posts: 815
- Joined: Fri 28. May 2004, 11:31
- Location: localhorst
- Contact:
look at this thread:
http://phpwcms.de/forum/viewtopic.php?t=4816
put this line in the code:
echo mysql_error();
and it will show what's wrong with sql.
hope that helps
http://phpwcms.de/forum/viewtopic.php?t=4816
Code: Select all
//------------------------------------------------------------------------------
// THIS IS FOR THE MOST_READ {RT}
// http://phpwcms.de/forum/viewtopic.php?t=4816
// http://dev-brenner-b-e/index.php/topic,42.0.html
//------------------------------------------------------------------------------
if ($count_str_sql=="") {
$count_str_sql ="insert into phpwcms_article_read_count values(now() , " .$content["article_id"] . "," . $content["cat_id"] . ")";
$count_sql = mysql_query($count_str_sql,$db);
if (!$count_sql) echo "sql error : " . $count_sql . " - " . $count_str_sql. "\n<br>";
echo mysql_error();
}
//------------------------------------------------------------------------------
echo mysql_error();
and it will show what's wrong with sql.
hope that helps
I try
but it does not save data into databse??? Do anyone get it?
Code: Select all
"insert into ".DB_PREPEND."phpwcms_article_read_count values(now() , " .$content["article_id"] . "," . $content["cat_id"] . ")";