[SOLVED] SQL problem ??? (not sure)
Posted: Thu 9. Nov 2006, 11:27
Hi,
I have tried to implement the RT {art_read} by Jensz but encounter - I think - a problem with a php-file or the sql-database.
Please check my site. On top of it it lists the following code:
:0} function get_article_read_cnt($art_id, $cat_id, $dbcon) { $count = 0; $sql ="SELECT count( article_id ) as art_cnt FROM ".DB_PREPEND."phpwcms_article_read_count WHERE article_id = $art_id AND cat_id = $cat_id "; if($result = mysql_query($sql, $dbcon)) { $row = mysql_fetch_assoc($result); $count = $row["art_cnt"]; mysql_free_result($result); } return $count; } // {ART_READ} if( ! ( strpos($content["all"],'{ART_READ:')===false ) ) { $content["all"] = preg_replace('/\{ART_READ:(\d+):(\d+)\}/e','get_article_read_cnt($1,$2,$db);',$content["all"]); } ?>
Why does it appear there? Any suggestion how to fix this?
Rolph
I have tried to implement the RT {art_read} by Jensz but encounter - I think - a problem with a php-file or the sql-database.
Please check my site. On top of it it lists the following code:
:0} function get_article_read_cnt($art_id, $cat_id, $dbcon) { $count = 0; $sql ="SELECT count( article_id ) as art_cnt FROM ".DB_PREPEND."phpwcms_article_read_count WHERE article_id = $art_id AND cat_id = $cat_id "; if($result = mysql_query($sql, $dbcon)) { $row = mysql_fetch_assoc($result); $count = $row["art_cnt"]; mysql_free_result($result); } return $count; } // {ART_READ} if( ! ( strpos($content["all"],'{ART_READ:')===false ) ) { $content["all"] = preg_replace('/\{ART_READ:(\d+):(\d+)\}/e','get_article_read_cnt($1,$2,$db);',$content["all"]); } ?>
Why does it appear there? Any suggestion how to fix this?
Rolph