al final, lo solucione quitando la funcion count, ademas el mysql_query estaba repetido
quedo así:
Código PHP:
function lecturas () {
global $tableposts,$id;
$sql = mysql_query("SELECT post_lecturas FROM $tableposts WHERE id = '$id'");
$lecturas = mysql_fetch_array($sql);
echo "$lecturas[0]";
}
y ya funciona!!
ahora creo que solo me falta la funcion que cuente cada vez que el articulo es visitado.
si alguien tiene una sugerencia se agradecera.
hasta ahora lo que tengo es:
Código PHP:
/*lecturas*/
if($p) {
$lecturas= mysql_query("Select post_lecturas from $tableposts where id='$id'");
if($lecturas=mysql_fetch_array($lecturas)) {
if ($lecturas == 0){
$lecturas = $lecturas + 1;
mysql_query("Insert into tableposts(post_lecturas) values ($lecturas) where id='$id'");
}else {
$lecturas = $lecturas + 1;
mysql_query("Update $tableposts Set post_lecturas='$lecturas' where id='$id'");
}
}
}
???