tools_sql修正select_table_to_array没有order参数的问题

This commit is contained in:
HuYingzhuo(hugo/hyzboy) 2023-07-07 18:32:55 +08:00
parent 09ff4e0a45
commit ce2814021b
3 changed files with 14 additions and 13 deletions

View File

@ -22,5 +22,4 @@
exit; exit;
} }
?>

View File

@ -48,7 +48,7 @@
// $this->table_name=$tn; // $this->table_name=$tn;
// } // }
// //
// public function get_field_list() // public function sql_get_field_list()
// { // {
// if($field_array) // if($field_array)
// return $field_array; // return $field_array;
@ -84,7 +84,7 @@
// } // }
// };//class SQLConnect // };//class SQLConnect
function get_field_list($sql,$table_name) function sql_get_field_list($sql,$table_name)
{ {
if($sql==null)return null; if($sql==null)return null;
@ -100,7 +100,7 @@
return $field_array; return $field_array;
} }
function select_table()//$sql,$table_name,$field_array,$where,$order,$start,$count) function sql_select_table()//$sql,$table_name,$field_array,$where,$order,$start,$count)
{ {
$sql =func_get_arg(0); $sql =func_get_arg(0);
$table_name =func_get_arg(1); $table_name =func_get_arg(1);
@ -156,17 +156,19 @@
return null; return null;
} }
function select_table_to_array()//$sql,$table_name,$field_array,$where,$start,$count) function sql_select_table_to_array()//$sql,$table_name,$field_array,$where,$order,$start,$count)
{ {
$sql =func_get_arg(0); $sql =func_get_arg(0);
$table_name =func_get_arg(1); $table_name =func_get_arg(1);
$field_array =func_get_arg(2); $field_array=func_get_arg(2);
if(func_num_args()>3)$where=func_get_arg(3); if(func_num_args()>3)$where=func_get_arg(3);else $where=null;
if(func_num_args()>4) if(func_num_args()>4)$order=func_get_arg(4);else $order=null;
if(func_num_args()>5)
{ {
$start=func_get_arg(4); $start=func_get_arg(5);
$count=func_get_arg(5); $count=func_get_arg(6);
} }
else else
{ {
@ -174,7 +176,7 @@
$count=0; $count=0;
} }
$sql_result=select_table($sql,$table_name,$field_array,$where,$start,$count); $sql_result=sql_select_table($sql,$table_name,$field_array,$where,$order,$start,$count);
if(!$sql_result)return(null); if(!$sql_result)return(null);