Page 1 of 1

[SOLVED] SQL problem ??? (not sure)

Posted: Thu 9. Nov 2006, 11:27
by liro
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

Posted: Thu 9. Nov 2006, 18:08
by pico
Hi

no - this is not a Problem with the Database - this is a 'selfmade' Problem by you ;) seems that you have forgotten or added somewhere somthing by adding the art_read RT - check all Files you have edited again - this is Code from the Script and the Error must be short before this chown Code starts.
This comes from the PHP Interpreter - he stops correct working at this Point.