Related Post

[php]

<?php if (isset($_GET['id'])){ ?>
<?php include 'includes/data.php'; $query = "select * FROM $_GET[page] WHERE id = '$_GET[id]'"; $result = mysql_query($query); $row = mysql_fetch_array($result); $title = mysql_real_escape_string($title); ?>

Related Posts to <?php echo $row['title']; ?>

<?php $querys = "SELECT * FROM $_GET[page] WHERE article LIKE '%\$title\%' && id != '$_GET[id]'"; $results = mysql_query($querys); while ($rows = mysql_fetch_array($results)) {

echo ‘<a href=index.php?news&page=’.$_GET[page].’&id=’.$rows[id].’>’.$rows[title].’, ';

}?>

<?php } ?> [/php]

For some reason it will not output the posts that are like the other articles in the database.

Does it give any errors? If not, try putting:

[php]error_reporting(E_ALL);[/php]

At the start of your code and see if it displays any.

If it still doesn’t, try echoing the queries before they are run and then try them in a database admin tool such as phpMyAdmin.

Sponsor our Newsletter | Privacy Policy | Terms of Service