Php fetch rows from multiple MySQL tables
- by Jon McIntosh
Right now I am fetching all of the rows from one of my tables:
query = "SELECT * FROM thread WHERE threadid = 2 ORDER BY threadid DESC";
$result = mysql_query($query);
$num_rows = mysql_num_rows($result);
if((!is_bool($result) || $result) && $num_rows) {
while($row = mysql_fetch_array($result))
{
$thread = $row['title'];
$threadID = $row['threadid'];
$poster = $row['postusername'];
}
What I want to do is go to another table on my database: "post_display", and get the row 'text' where the threadid = 2.