Simple table JOIN
Posted: Fri Jul 05, 2002 9:49 pm
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'];
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'];