Ver Mensaje Individual
  #4 (permalink)  
Antiguo 10/04/2011, 16:10
Bam_Margera
 
Fecha de Ingreso: febrero-2009
Mensajes: 580
Antigüedad: 15 años, 3 meses
Puntos: 13
Respuesta: Post relacionados

Podrías hacerle un echo a una de las consultas y pegárnosla? (tb si usas las etiquetas para poner código php en tus mensajes del foro, los veremos así)


Código PHP:
<?php
// Comprobar si accede directamente
if(!defined($config['define'])) { header('Location: /index.php'); }
// 360 303 303
if($_GET['title'] && $_GET['id']) {
$title mysql_clean(str_replace('-'' '$_GET['title']));
$rq = (substr_count($title' ') == "SELECT title, id, cat, MATCH(title, message) AGAINST('".$title."') AS score FROM `posts` WHERE (title LIKE '%".$title."%' OR message LIKE '%".$title."%')" "SELECT *, MATCH(title, message) AGAINST('".$title."') AS score FROM `posts` WHERE MATCH(title, message) AGAINST('".$title."')");
$rq .= " && id != '".mysql_clean($_GET['id'])."' ORDER BY score DESC LIMIT 10";
$rquery mysql_query($rq);
while(
$relatedpost mysql_fetch_array($rquery)) {
$relatedcat mysql_fetch_array(mysql_query("SELECT urlname, name FROM `categories` WHERE id = '".$relatedpost['cat']."'"));
echo 
'<li class="categoriaPost '.$relatedcat['urlname'].'"><a href="/posts/'.$relatedcat['name'].'/'.$relatedpost['id'].'/'.url($relatedpost['title']).'.html">'.htmlspecialchars($relatedpost['title']).'</a></li>';
}
// title
?>
Así es más cómodo (de hecho, lo voy a leer ahora xD)
__________________
¿ya conoces la red social de cocina? descubre y comparte recetas de cocina
TONIWEB, un programador web freelance