Here is my predicament:
Data are pulled from 2 tables
One is: "articles" the other one is: "discussion"
I would like to be able to echo the title of any articles that have been commented (In discussion table)
In order for users at first glance to be aware that comments have been added
I have for test purpose created the following little script
That uses INNER JOIN and should echo "title from articles"
Understand that I need to use join table because
I need to display "title" only if comments have been added in "discussions"
and "title column " is only found in "articles"
my test script does not create errors but results and in an empty screen!
any input?
Thanks
Regards
Henry
<?php
above are the connect usual lines....
$link_id = db_connect('fingerlakesbusinessalmanac');
$result = mysql_query("SELECT articles.ID FROM articles INNER JOIN discussions
ON articles.ID=discussions.articleID WHERE
while($query_data=mysql_fetch_array($result)",$link_id);
{
echo $query_data["title"],"<p>";
}
?>
Data are pulled from 2 tables
One is: "articles" the other one is: "discussion"
I would like to be able to echo the title of any articles that have been commented (In discussion table)
In order for users at first glance to be aware that comments have been added
I have for test purpose created the following little script
That uses INNER JOIN and should echo "title from articles"
Understand that I need to use join table because
I need to display "title" only if comments have been added in "discussions"
and "title column " is only found in "articles"
my test script does not create errors but results and in an empty screen!
any input?
Thanks
Regards
Henry
<?php
above are the connect usual lines....
$link_id = db_connect('fingerlakesbusinessalmanac');
$result = mysql_query("SELECT articles.ID FROM articles INNER JOIN discussions
ON articles.ID=discussions.articleID WHERE
while($query_data=mysql_fetch_array($result)",$link_id);
{
echo $query_data["title"],"<p>";
}
?>