echo ‘Søgeord: ‘;
echo $query;
$sql = mysql_query(“SELECT DISTINCT * FROM tmpae2a43_posts LEFT JOIN
(wp_term_taxonomy, wp_terms, wp_term_relationships)
ON ( tmpae2a43_posts.ID = wp_term_relationships.object_id
AND wp_term_taxonomy.term_taxonomy_id = wp_term_relationships.term_taxonomy_id
AND wp_terms.term_id = wp_term_taxonomy.term_id )
WHERE slug LIKE CONCAT( ‘%”.$query.”%’) AND (wp_term_taxonomy.taxonomy = ‘IndexOrd’ OR wp_term_taxonomy.taxonomy = ‘Aarstal’) AND tmpae2a43_posts.post_type = ‘koegebasen'”);
while ($row = mysql_fetch_array($sql)) {
$title = $row[5];
$content = $row[4];
$post_id = $row[0];
$aarstal_sql = mysql_query(“SELECT DISTINCT * FROM tmpae2a43_posts LEFT JOIN
(wp_term_taxonomy, wp_terms, wp_term_relationships)
ON ( tmpae2a43_posts.ID = wp_term_relationships.object_id
AND wp_term_taxonomy.term_taxonomy_id = wp_term_relationships.term_taxonomy_id
AND wp_terms.term_id = wp_term_taxonomy.term_id )
WHERE tmpae2a43_posts.ID = $post_id
AND wp_term_taxonomy.taxonomy = ‘Aarstal’
AND tmpae2a43_posts.post_type = ‘koegebasen'”);
while($aar_row = mysql_fetch_assoc($aarstal_sql))
{
$aarstal = $aar_row[“slug”];
echo “[h2]$title $aarstal[/h2] $content[/p]”;
}
}
[/php]