//print $forum['lastpost']['author']; //出来是个'wei',//print $new_id; $dd="select nickname from cdb_memberfields b,cdb_members a where a.username='$forum['lastpost']['author']' and b.uid=a.uid ";//不能查到!,但是把where a.username='wei'能够查到 $result=mysql_query($dd);如果用print $forum['lastpost']['author']; 出来的'wei'字符串,是一个链接!如果用$author = $forum['lastpost']['author'],在用print $author 打印出来,还是个链接!!
但是话说回来, $dd="select nickname from cdb_memberfields b,cdb_members a where a.username='$forum['lastpost']['author']' and b.uid=a.uid ; $result=mysql_query($dd);用 print $dd;出来的语句是查得出来的啊,比如 select nickname from cdb_memberfields b,cdb_members a where a.username='wei' and b.uid=a.uid 但是上面的wei字符串有链接的!!
$dd="select nickname from cdb_memberfields b,cdb_members a where a.username='$forum['lastpost']['author']' and b.uid=a.uid ";//不能查到!,但是把where a.username='wei'能够查到 -------------------------------- 这个你改成下面的试试 $author=preg_replace("/<a.*?>(.+?)</a>/is","$1",$forum['lastpost']['author']); $dd="select nickname from cdb_memberfields b,cdb_members a where a.username='$author' and b.uid=a.uid ";
早贴出代码不是早解决了?$dd = "select nickname from cdb_memberfields b,cdb_members a where a.username='{$forum['lastpost']['author']}' and b.uid=a.uid "; 或 $dd = "select nickname from cdb_memberfields b,cdb_members a where a.username='".$forum['lastpost']['author']."' and b.uid=a.uid ";
不行啊,打印出来的还是老样子,有 select nickname from cdb_memberfields b,cdb_members a where a.username='wei' and b.uid=a.uid 但是查询不到,可是wei还是有链接的!!!555555555,惨了,这难关过不去了
$author=preg_replace("/<a.*?>(.+?)</a>/is","$1",$forum['lastpost']['author']); 用这个报如下错 Warning: preg_replace(): Unknown modifier 'a' in D:\Apache2\htdocs\Discuz4\upload\forumdata\templates\1_index.tpl.php on line 95
然后用$author做查询试试
$forum['lastpost']['author']的值包含了连接的代码
就是<a href ...........>这些
你把内容靠过去直接用因为没包含<a href>这些所以就可以
你后面说的直接print出来只个连接也说明了包含连接代码
所以你要对$forum['lastpost']['author']作下处理, 把里面的连接部分的字符去掉
$dd="select nickname from cdb_memberfields b,cdb_members a where a.username='$forum['lastpost']['author']' and b.uid=a.uid ";//不能查到!,但是把where a.username='wei'能够查到
$result=mysql_query($dd);如果用print $forum['lastpost']['author']; 出来的'wei'字符串,是一个链接!如果用$author = $forum['lastpost']['author'],在用print $author 打印出来,还是个链接!!
$dd="select nickname from cdb_memberfields b,cdb_members a where a.username='$forum['lastpost']['author']' and b.uid=a.uid ;
$result=mysql_query($dd);用 print $dd;出来的语句是查得出来的啊,比如
select nickname from cdb_memberfields b,cdb_members a where a.username='wei' and b.uid=a.uid 但是上面的wei字符串有链接的!!
--------------------------------
这个你改成下面的试试
$author=preg_replace("/<a.*?>(.+?)</a>/is","$1",$forum['lastpost']['author']);
$dd="select nickname from cdb_memberfields b,cdb_members a where a.username='$author' and b.uid=a.uid ";
或
$dd = "select nickname from cdb_memberfields b,cdb_members a where a.username='".$forum['lastpost']['author']."' and b.uid=a.uid ";
select nickname from cdb_memberfields b,cdb_members a where a.username='wei' and b.uid=a.uid 但是查询不到,可是wei还是有链接的!!!555555555,惨了,这难关过不去了
用这个报如下错
Warning: preg_replace(): Unknown modifier 'a' in D:\Apache2\htdocs\Discuz4\upload\forumdata\templates\1_index.tpl.php on line 95