header("Content-Type: text/html;charset=utf-8"); $mysql_server="xxxxx"; $mysql_username="xxxxx"; $mysql_password="xxxx"; $mysql_database="xxxxx"; //建立数据库链接 $conn = mysql_connect($mysql_server,$mysql_username,$mysql_password) or die("数据库链接错误"); //选择某个数据库 mysql_select_db($mysql_database,$conn); mysql_query("set names 'utf8'"); //执行MySQL语句 //提取数据\\ $v=$_POST['value']; /*$re=mysql_query("SELECT distinct user_apps.app_name,ald_session_logs.version FROM user_apps LEFT JOIN ald_session_logs ON user_apps.app_key=ald_session_logs.app_key WHERE app_name LIKE '%$v%'"); $res=mysql_query("SELECT aladdin_user.id,aladdin_user.name,aladdin_user.company,user_app_relations.app_key FROM aladdin_user LEFT JOIN user_app_relations ON aladdin_user.id=user_app_relations.aladdin_id");*/ $re=mysql_query("SELECT distinct user_apps.app_name,ald_session_logs.version,aladdin_user.id,aladdin_user.name,aladdin_user.company,user_app_relations.app_key FROM user_apps LEFT JOIN ald_session_logs ON user_apps.app_key=ald_session_logs.app_key LEFT join user_app_relations ON ald_session_logs.app_key=user_app_relations.app_key LEFT JOIN aladdin_user ON user_app_relations.aladdin_id=aladdin_user.id WHERE user_apps.app_name LIKE '%$v%'"); if(mysql_num_rows($re)<=0) exit('0'); echo '<ul>'; while($ro=mysql_fetch_array($re))if($ro['version']==0){ echo '<li><a href="">'.$ro['app_name'].'------否</a></li>'; } else{ echo '<li><a href=""><font color="red">公司名称:'.$ro['company'].'</font>---'.$ro['app_name'].'-----是('.$ro['version'].')版本</a></li>'; } echo '<li class="cls"><a href="javascript:;" onclick="$(this).parent().parent().parent().fadeOut(100)">关闭</a></li>'; echo '</ul>'; (责任编辑:IT) |