Have tried every combination, and researched...no luck, just need to join two tables which have the same columns. The following works, but need to add/join the other table, it's for a calendar of events.
Other table: "hr_sub", uses the same WHERE, and ORDER BY...Thanbks if you can help, B.
$qr = mysql_query("SELECT * FROM cal_main WHERE LEFT(mdate, 6) = '".$tab."' ORDER BY mdate");
$nrows = mysql_num_rows($qr);
$rString = "n=".$nrows;
for ($i=0; $i < $nrows; $i++) {
$row = mysql_fetch_array($qr);
$rString .= "&mdate".$i."=".$row['mdate']."&title".$i."=".$row['title'];
$rString .= "&info".$i."=".$row['info']."&email".$i."=".$row['email'];
$rString .= "&url_ad".$i."=".$row['url_ad']."&caption".$i."=".$row['caption'];
Simple table JOIN
Moderator: General Moderators
If get your question right:Have tried every combination, and researched...no luck, just need to join two tables which have the same columns.
Code: Select all
SELECT table1.col1 , table2.col1, table3.col1
FROM table1, table2, table3
WHERE table1.col1 = table2.col1
AND table2.col1 = table3.col1
ORDER BY table1.col1