Not 100% sure on this, but wouldn't this have something to do with it:
Code:
// get job data
$sql = "SELECT * FROM `jobs` WHERE username = '$user' ORDER BY id DESC";
$jobs = mysql_query($sql) or die ('Error Getting Job Data! <br />' .mysql_error());
$j = mysql_fetch_array($jobs);
$title = $j['title'];
$comments = mysql_query("SELECT * FROM `comments` WHERE job = '$title'") or die ('Error Checking Comments! <br />' .mysql_error());
$c = mysql_fetch_array($comments);
// Display jobs
while($job = mysql_fetch_array($jobs)) {
if($job['title'] !== $c['title']) {
echo '
<a href="comment.php?page=add&id='.$job['id'].'">'.$job['title'].'</a>
<br />';
}
}
It seems to me that you are selecting jobs that are already commented on. That is why you are not getting any links to show up. Try removing the part in red in the above snippet.
Hope this helps.
Added Later:
---------------------------------------
After looking at the original script a little more, if what I posted above doesn't work, try undoing that and removing the following part in red.
Code:
// get job data
$sql = "SELECT * FROM `jobs` WHERE username = '$user' ORDER BY id DESC";
$jobs = mysql_query($sql) or die ('Error Getting Job Data! <br />' .mysql_error());
$j = mysql_fetch_array($jobs);
$title = $j['title'];
$comments = mysql_query("SELECT * FROM `comments` WHERE job = '$title'") or die ('Error Checking Comments! <br />' .mysql_error());
$c = mysql_fetch_array($comments);
// Display jobs
while($job = mysql_fetch_array($jobs)) {
if($job['title'] !== $c['title']) {
echo '
<a href="comment.php?page=add&id='.$job['id'].'">'.$job['title'].'</a>
<br />';
}
}
Bookmarks