Fixed the bug #424278: Display xx records on the select page

This commit is contained in:
Loïc Chapeaux
2001-05-18 21:34:58 +00:00
parent dbbbe7757f
commit 49d504fe82

View File

@@ -5,16 +5,13 @@
require("grab_globals.inc.php3");
if(!isset($param) || $param[0] == "")
{
require("header.inc.php3");
if(!isset($param) || $param[0] == "") {
include("header.inc.php3");
$result = mysql_list_fields($db, $table);
if (!$result)
{
if (!$result) {
mysql_die();
}
else
{
else {
?>
<form method="POST" ACTION="tbl_select.php3">
<input type="hidden" name="server" value="<?php echo $server;?>">
@@ -25,8 +22,7 @@ if(!isset($param) || $param[0] == "")
<select multiple NAME="param[]" size="10">
<?php
for ($i=0 ; $i<mysql_num_fields($result); $i++)
{
for ($i=0 ; $i<mysql_num_fields($result); $i++) {
$field = mysql_field_name($result,$i);
if($i >= 0)
echo "<option value=$field selected>$field</option>\n";
@@ -37,7 +33,7 @@ if(!isset($param) || $param[0] == "")
</select><br>
<div align="left">
<ul><li><?php echo $strDisplay; ?> <input type="text" size=4 name = "sessionMaxRows" value=<?php echo $cfgMaxRows; ?>>
<ul><li><?php echo $strDisplay; ?> <input type="text" size=4 name="sessionMaxRows" value=<?php echo $cfgMaxRows; ?>>
<?php echo $strLimitNumRows; ?>
<li><?php echo $strAddSearchConditions; ?><br>
<input type="text" name="where"> <?php print show_docu("manual_Reference.html#Functions");?><br>
@@ -52,13 +48,12 @@ if(!isset($param) || $param[0] == "")
</tr>
<?php
$result = mysql_list_fields($db, $table);
for ($i=0;$i<mysql_num_fields($result);$i++)
{
for ($i=0;$i<mysql_num_fields($result);$i++) {
$field = mysql_field_name($result,$i);;
$type = mysql_field_type($result,$i);
$len = mysql_field_len($result,$i);
$bgcolor = $cfgBgcolorOne;
$i % 2 ? 0: $bgcolor = $cfgBgcolorTwo;
($i % 2) ? 0: $bgcolor = $cfgBgcolorTwo;
echo "<tr bgcolor=".$bgcolor.">";
echo "<td>$field</td>";
@@ -69,41 +64,41 @@ if(!isset($param) || $param[0] == "")
echo "</tr>";
}
echo "</table><br>";
?>
?>
<input name="SUBMIT" value="<?php echo $strGo; ?>" type="SUBMIT">
</form></ul>
<?php
}
require ("footer.inc.php3");
}
else
{
include("footer.inc.php3");
}
else {
$sql_query="SELECT $param[0]";
$i=0;
$c=count($param);
while($i < $c)
{
while($i < $c) {
if($i>0) $sql_query .= ",$param[$i]";
$i++;
}
$sql_query .= " from $table";
if ($where != "") {
$sql_query .= " where $where";
} else {
}
else {
$sql_query .= " where 1";
for ($i=0;$i<count($fields);$i++)
{
for ($i=0;$i<count($fields);$i++) {
if (!empty($fields) && $fields[$i] != "") {
$quot="";
if ($types[$i]=="string"||$types[$i]=="blob") {
$quot="\"";
$cmp="like";
} elseif($types[$i]=="date"||$types[$i]=="time") {
}
elseif($types[$i]=="date"||$types[$i]=="time") {
$quot="\"";
$cmp="=";
} else {
}
else {
$cmp="=";
$quot="";
if (substr($fields[$i],0,1)=="<" || substr($fields[$i],0,1)==">") $cmp="";
@@ -112,7 +107,11 @@ else
}
}
}
Header("Location:sql.php3?sql_query=".urlencode($sql_query)."&goto=db_details.php3&server=$server&lang=$lang&db=$db&table=$table&pos=0&sessionMaxRows=$sessionMaxRows");
if (empty($sessionMaxRows)) {
include("config.inc.php3");
$sessionMaxRows = $cfgMaxRows;
}
Header("Location:sql.php3?sql_query=".urlencode($sql_query)."&goto=db_details.php3&server=$server&lang=$lang&db=$db&table=$table&pos=0&sessionMaxRows=$sessionMaxRows");
}
?>