我有2個表: 1.message 2.replaytomessage選擇從2表通過ID和PARENTID
表有2個相同的申請: 1.title 2.matn
在郵件存儲的話題在replaytomessage店重播主題 replaytomessage鏈接消息parentmid申請
我希望寫在這兩個表例如搜索我搜索「測試」,選擇查詢,找到儲存在信息標題& matn e和replaytomessage
我寫這篇文章的查詢:
$result = mysql_query("SELECT * FROM message inner Join replaytomessage On message.mid = replaytomessage.parentmid WHERE message.matn LIKE '%$qfind%' OR message.title LIKE '%$qfind%' ORDER BY message.mid DESC LIMIT $start, $per_page") or die(mysql_error());
但結果表明replaytomessage數據或不正確的標題...
this is my While :
while($row = mysql_fetch_array($result)) {
echo "<tr>";
echo "<td width = '300'>";
$title = mysql_real_escape_string($row['title']);
$mid = intval($row['mid']);
$member = intval($row['member_id']);
echo "<a href = 'message.php?mid=$mid'>$title</a>";
echo "</td> ";
}