Forum Moderators: coopster
So query the info from two tables BUT only show the result if the column in the second table does not have a value (its NULL meaning no comments have been made). Can anyone help me with this or point me in the right direction. This is what I have so far (which only pulls all the data within the first table):
//connect to mysql
mysql_connect(localhost,$username,$password);//select database
mysql_select_db("main_database");
//select the table
$result = mysql_query("select * from articles");
//grab all the content
while($r=mysql_fetch_array($result))
{
//modify these to match your mysql table columns
$title=$r["title"];
$entry=$r["entry"];
$user=$r["user"];
$date=$r["posted"];
$views=$r["views"];
$type=$r["type"];
//display the row
echo "$title <br> entry id: $entry <br> user id: $user <br> $date <br>type: <br>";
}
Thank you for your time