$idc = $_GET['id'];
$name1 = $_GET['name'];
$id2 = $_GET['ids'];
$toplinks = "";
if (isset($_SESSION['category_id'])) {
// Put stored session variables into local php variable
$userid = $_SESSION['id'];
$username = $_SESSION['name'];
}
$sql_2 = mysql_query("SELECT * FROM blabbing WHERE mem_id='$userid' OR men_id='$idc' ORDER BY blab_date DESC LIMIT 20")
while($row = mysql_fetch_array($sql_2)){
}
答案 0 :(得分:4)
我认为您的查询中存在错误...您引用了mem_id
然后是OR men_id
尝试将or die ( mysql_error () );
添加到mysql_query行。
即
$sql_2 = mysql_query("SELECT * FROM blabbing WHERE mem_id='$userid' OR mem_id='$idc' ORDER BY blab_date DESC LIMIT 20") or die ( mysql_error () );
答案 1 :(得分:1)
你先mysql_connect
了吗?