I am trying to give my each blog posts a permalink where upon clicking the blog post's title on the main page the database exclusively shows the respective blog post. I have used the following PHP code, but the result is a blank page. Obviously there are errors in the code. So please help me debugging it so that it works effectively. The code is as: $result = mysql_query("SELECT post_title, post_body From posts ORDER BY post_no DESC $limit"); while($row = mysql_fetch_array($result)) { $title = $row[0]; $content = $row[1]; $perma_link = mysql_query("SELECT post_title, post_body FROM posts WHERE post_title = $row[0]"); echo("<h3>"'<a href="{$_SERVER['PHP_SELF']}?$perma_link">$title</a> ."</h3><hr style='color: brown'><br/> .$content" ."<hr style='width: 80%; align: center; color: brown'><br/><br/><br/>"); }; $result = mysql_query($query, $con_mysql_db) or trigger_error("SQL", E_USER_ERROR);
You have quite a few errors in thaqt script, starting at where you try to set $perma_link... what do you want $perma_link to contain?