|
本次悬赏总金额:100 金币 |
剩余悬赏金额:100 金币
本次悬赏到期时间:
本悬赏贴永不过期。
只允许悬赏会员本人发放悬赏金币
|
只允许悬赏会员本人收回悬赏金币
|
最多悬赏人数:10人
还没有会员获得悬赏奖励,加油,快来争头奖!
本帖最后由 yunabc 于 2017-2-11 17:35 编辑
- <?php
- session_start();
- error_reporting(0);
- header("Content-type: text/html; charset=utf-8");
- require "config.php";
- @date_default_timezone_set(PRC);
- set_time_limit(0);
- @ob_end_clean();
- ob_implicit_flush(true);
- switch($_GET['act']){
- case "database":
- if(empty($_SESSION['member'])){
- exit('var database=new Array("login");');
- }
- $connect_db = mysql_connect($dbnhost, $dbnuser, $dbnpass);
- $select_db = mysql_select_db($dbname, $connect_db);
- mysql_query("SET NAMES 'UTF8'");
- mysql_query("SET CHARACTER SET UTF8");
- mysql_query("SET CHARACTER_SET_RESULTS=UTF8");
- $rs = mysql_query("SHOW TABLES FROM $dbname");
- $tables = array();
- while ($row = mysql_fetch_row($rs)) {
- $tables[] = $row[0];
- }
- mysql_free_result($rs);
- $array_tj=count($tables);
- $count=1;
- $text="";
- foreach($tables as $key=>$tableName){
- if($key==count($tables)-1){
- $dian="";
- }else{
- $dian=",";
- }
- $text=$text.'"'.$tableName.'"'.$dian;
- $count++;
- }
- echo "var database = new Array($text);";
- break;
- case "select":
- if(empty($_SESSION['member'])){
- echo "cnrv_msg("请登录");addRow("登录后查询","登录后查询","登录后查询","登录后查询","登录后查询");";
- exit;
-
- }
- $select_act=(int)addslashes(trim($_POST['select_act']));
- $match_act=(int)addslashes(trim($_POST['match_act']));
- $key=addslashes(trim($_POST['key']));
- $table=addslashes(trim($_POST['table']));
- if(empty($key) || $key==''){exit("请输入查询内容");}
- if(strlen($key)<4){exit("key length!!!");}
-
- $key = str_replace("_","\_",$key);
- $key = str_replace("%","\%",$key);
- switch($match_act){
- case 2:$key = '=\''.$key.'\'';break;
- case 1:$key = ' like \''.$key.'%\'';break;
- default:exit("???");
- }
- switch($select_act){//查询方式
- case 1:$limits="username".$key;break;
- case 2:$limits="email".$key;break;
- case 3:$limits="username".$key."or email".$key."or source".$key;break;
- default:exit("???");
- }
- $connect_db = mysql_connect($dbnhost, $dbnuser, $dbnpass);
- $select_db = mysql_select_db($dbname, $connect_db);
- mysql_query("SET NAMES 'UTF8'");
- mysql_query("SET CHARACTER SET UTF8");
- mysql_query("SET CHARACTER_SET_RESULTS=UTF8");
- $sql="select $Field from `$table` where $limits LIMIT 30";
- require "database.php";
- $databasename=database($table);
- if($result=mysql_query($sql)){
- while($rows=mysql_fetch_assoc($result)){
- $username= mysql_real_escape_string($rows['username']);
- $email= mysql_real_escape_string($rows['email']);
- $password= mysql_real_escape_string($rows['password']);
- $source= mysql_real_escape_string($rows['source']);
- $log= mysql_real_escape_string($rows['log']);
- echo "addRow("$username","$email","$password","$source","$log");";
- }// end while
- }
-
-
-
-
- break;
- default:print_r("???");
- }
-
复制代码 这个是输出的代码,我的数据库本来准备输出5组数据,或者6组数,但是只能输出前4组,到了第5组就不显示- while($rows=mysql_fetch_assoc($result)){
- $username= mysql_real_escape_string($rows['username']);
- $email= mysql_real_escape_string($rows['email']);
- $password= mysql_real_escape_string($rows['password']);
- $source= mysql_real_escape_string($rows['source']);
- $log= mysql_real_escape_string($rows['log']);
- $nice= mysql_real_escape_string($rows['nice']);
- echo "addRow("$username","$email","$password","$log","$source","$nice");";
- }// end while
复制代码 数据输出是正常的,最后两个数据替换了都是可以单个输出的,但是一超过4组就并不显示第5组了,小白,网上找的代码,人家本来是三组,我加的,求大神修改显示后边的数据
|
|