| Neuer Benutzer
Registriert seit: 03.02.2010
Beiträge: 15
PHP-Kenntnisse: Anfänger
| Excelausgabe Suchformular Hallo,
habe folgendes Problem:
Habe ein Suchformular Excel_Search.php und ein Ausgabeformular Excel_liste.php
Wenn ich die Suchergebnisse an das Ausgabeformular übergebe wird die komplette DB inkl aller DS ausgegeben und nicht die gesuchten DS
Kann mir jemand helfen, dass nur die gesuchten DS ausgegeben werden.
Bin bald am verweifeln
Code Excel_search.php PHP-Code: <?php require_once('Connections/Verbindung.php'); ?>
<?php
$mysearchkey = $_POST['mysearch'];
$mysearchkey1 = $_POST['mysearch1'];
$mysearchkey2 = $_POST['mysearch2'];
$mysearchkey3 = $_POST['mysearch3'];
$mysearchkey4 = $_POST['mysearch4'];
$mysearchkey5 = $_POST['mysearch5'];
$mysearchkey6 = $_POST['mysearch6'];
$mysearchkey7 = $_POST['mysearch7'];
$mysearchkey8 = $_POST['mysearch8'];
$mysearchkey9 = $_POST['mysearch9'];
$mysearchkey10 = $_POST['mysearch10'];
$mysearchkey11 = $_POST['mysearch11'];
$mysearchkey12 = $_POST['mysearch12'];
$mysearchkey13 = $_POST['mysearch13'];
$mysearchkey14 = $_POST['mysearch14'];
$mysearchkey15 = $_POST['mysearch15'];
$mysearchkey16 = $_POST['mysearch16'];
$mysearchkey17 = $_POST['mysearch17'];
$mysearchkey18 = $_POST['mysearch18'];
$mysearchkey19 = $_POST['mysearch19'];
$mysearchkey20 = $_POST['mysearch20'];
$mysearchkey21 = $_POST['mysearch21'];
$mysearchkey22 = $_POST['mysearch22'];
$mysearchkey23 = $_POST['mysearch23'];
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
//Abfrage
mysql_query($database_Verbindung, $Verbindung);
$query_text = "SELECT * FROM tblpsrmonth WHERE ((PartNo LIKE '%$mysearchkey%') AND (SupplierName Like '%$mysearchkey1%') AND (Plant Like '%$mysearchkey2%') AND (Region Like '%$mysearchkey3%') AND (ProductLine Like '%$mysearchkey4%') AND (ProductGroup Like '%$mysearchkey5%') AND (Geometry Like '%$mysearchkey6%') AND (LabelCategory Like '%$mysearchkey7%') AND (LabelMaterial Like '%$mysearchkey8%') AND (TestSpec Like '%$mysearchkey9%') AND (DeliverySpec Like '%$mysearchkey10%') AND (MatSpec Like '%$mysearchkey11%') AND (MatCodeManuf Like '%$mysearchkey12%') AND (Adhesive Like '%$mysearchkey13%') AND (ColorRal Like '%$mysearchkey14%') AND (ColorPantone Like '%$mysearchkey15%') AND (Warntext Like '%$mysearchkey16%') AND (SupplierLcc Like '%$mysearchkey17%') AND (LengthPart Like '%$mysearchkey18%') AND (WidthPart Like '%$mysearchkey19%') AND (ThicknessPart Like '$mysearchkey20%') AND (POCurrencyCode Like '%$mysearchkey21%') AND (DrawingNo Like '%$mysearchkey22%') AND (Perforation Like '%$mysearchkey23%'))";
$rs_Search = mysql_query($query_text, $Verbindung) or die(mysql_error());
$row_rs_Search = mysql_fetch_assoc($rs_Search);
$totalRows_rs_Search = mysql_num_rows($rs_Search);
$maxRows_rs_Plant = 1;
$pageNum_rs_Plant = 0;
if (isset($_GET['pageNum_rs_Plant'])) {
$pageNum_rs_Plant = $_GET['pageNum_rs_Plant'];
}
$startRow_rs_Plant = $pageNum_rs_Plant * $maxRows_rs_Plant;
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_Plant = "SELECT Distinct Plant FROM tblpsrmonth ORDER BY Plant";
$query_limit_rs_Plant = sprintf("%s LIMIT %d, %d", $query_rs_Plant, $startRow_rs_Plant, $maxRows_rs_Plant);
$rs_Plant = mysql_query($query_limit_rs_Plant, $Verbindung) or die(mysql_error());
$row_rs_Plant = mysql_fetch_assoc($rs_Plant);
if (isset($_GET['totalRows_rs_Plant'])) {
$totalRows_rs_Plant = $_GET['totalRows_rs_Plant'];
} else {
$all_rs_Plant = mysql_query($query_rs_Plant);
$totalRows_rs_Plant = mysql_num_rows($all_rs_Plant);
}
$totalPages_rs_Plant = ceil($totalRows_rs_Plant/$maxRows_rs_Plant)-1;
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_Supplier = "SELECT Distinct SupplierName FROM tblpsrmonth ORDER BY SupplierName";
$rs_Supplier = mysql_query($query_rs_Supplier, $Verbindung) or die(mysql_error());
$row_rs_Supplier = mysql_fetch_assoc($rs_Supplier);
$totalRows_rs_Supplier = mysql_num_rows($rs_Supplier);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_Region = "SELECT Distinct Region FROM tblpsrmonth ORDER BY Region";
$rs_Region = mysql_query($query_rs_Region, $Verbindung) or die(mysql_error());
$row_rs_Region = mysql_fetch_assoc($rs_Region);
$totalRows_rs_Region = mysql_num_rows($rs_Region);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_ProductLine = "SELECT Distinct ProductLine FROM tblpsrmonth ORDER BY ProductLine";
$rs_ProductLine = mysql_query($query_rs_ProductLine, $Verbindung) or die(mysql_error());
$row_rs_ProductLine = mysql_fetch_assoc($rs_ProductLine);
$totalRows_rs_ProductLine = mysql_num_rows($rs_ProductLine);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_ProductGroup = "SELECT Distinct ProductGroup FROM tblpsrmonth ORDER BY ProductGroup";
$rs_ProductGroup = mysql_query($query_rs_ProductGroup, $Verbindung) or die(mysql_error());
$row_rs_ProductGroup = mysql_fetch_assoc($rs_ProductGroup);
$totalRows_rs_ProductGroup = mysql_num_rows($rs_ProductGroup);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_Geometry = "SELECT Distinct Geometry FROM tblpsrmonth ORDER BY Geometry";
$rs_Geometry = mysql_query($query_rs_Geometry, $Verbindung) or die(mysql_error());
$row_rs_Geometry = mysql_fetch_assoc($rs_Geometry);
$totalRows_rs_Geometry = mysql_num_rows($rs_Geometry);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_LabelCategory = "SELECT Distinct LabelCategory FROM tblpsrmonth ORDER BY LabelCategory";
$rs_LabelCategory = mysql_query($query_rs_LabelCategory, $Verbindung) or die(mysql_error());
$row_rs_LabelCategory = mysql_fetch_assoc($rs_LabelCategory);
$totalRows_rs_LabelCategory = mysql_num_rows($rs_LabelCategory);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_LabelMaterial = "SELECT Distinct LabelMaterial FROM tblpsrmonth ORDER BY LabelMaterial";
$rs_LabelMaterial = mysql_query($query_rs_LabelMaterial, $Verbindung) or die(mysql_error());
$row_rs_LabelMaterial = mysql_fetch_assoc($rs_LabelMaterial);
$totalRows_rs_LabelMaterial = mysql_num_rows($rs_LabelMaterial);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_TestSpec = "SELECT Distinct TestSpec FROM tblpsrmonth ORDER BY TestSpec";
$rs_TestSpec = mysql_query($query_rs_TestSpec, $Verbindung) or die(mysql_error());
$row_rs_TestSpec = mysql_fetch_assoc($rs_TestSpec);
$totalRows_rs_TestSpec = mysql_num_rows($rs_TestSpec);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_DeliverySpec = "SELECT Distinct DeliverySpec FROM tblpsrmonth ORDER BY DeliverySpec";
$rs_DeliverySpec = mysql_query($query_rs_DeliverySpec, $Verbindung) or die(mysql_error());
$row_rs_DeliverySpec = mysql_fetch_assoc($rs_DeliverySpec);
$totalRows_rs_DeliverySpec = mysql_num_rows($rs_DeliverySpec);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_MatSpec = "SELECT Distinct MatSpec FROM tblpsrmonth ORDER BY MatSpec";
$rs_MatSpec = mysql_query($query_rs_MatSpec, $Verbindung) or die(mysql_error());
$row_rs_MatSpec = mysql_fetch_assoc($rs_MatSpec);
$totalRows_rs_MatSpec = mysql_num_rows($rs_MatSpec);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_MatCodeManuf = "SELECT Distinct MatCodeManuf FROM tblpsrmonth ORDER BY MatCodeManuf";
$rs_MatCodeManuf = mysql_query($query_rs_MatCodeManuf, $Verbindung) or die(mysql_error());
$row_rs_MatCodeManuf = mysql_fetch_assoc($rs_MatCodeManuf);
$totalRows_rs_MatCodeManuf = mysql_num_rows($rs_MatCodeManuf);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_Adhesive = "SELECT Distinct Adhesive FROM tblpsrmonth ORDER BY Adhesive";
$rs_Adhesive = mysql_query($query_rs_Adhesive, $Verbindung) or die(mysql_error());
$row_rs_Adhesive = mysql_fetch_assoc($rs_Adhesive);
$totalRows_rs_Adhesive = mysql_num_rows($rs_Adhesive);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_ColorRal = "SELECT Distinct ColorRal FROM tblpsrmonth ORDER BY ColorRal";
$rs_ColorRal = mysql_query($query_rs_ColorRal, $Verbindung) or die(mysql_error());
$row_rs_ColorRal = mysql_fetch_assoc($rs_ColorRal);
$totalRows_rs_ColorRal = mysql_num_rows($rs_ColorRal);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_Pantone = "SELECT Distinct ColorPantone FROM tblpsrmonth ORDER BY ColorPantone";
$rs_Pantone = mysql_query($query_rs_Pantone, $Verbindung) or die(mysql_error());
$row_rs_Pantone = mysql_fetch_assoc($rs_Pantone);
$totalRows_rs_Pantone = mysql_num_rows($rs_Pantone);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_Warntext = "SELECT Distinct Warntext FROM tblpsrmonth ORDER BY Warntext";
$rs_Warntext = mysql_query($query_rs_Warntext, $Verbindung) or die(mysql_error());
$row_rs_Warntext = mysql_fetch_assoc($rs_Warntext);
$totalRows_rs_Warntext = mysql_num_rows($rs_Warntext);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_SupplierLcc = "SELECT Distinct SupplierLcc FROM tblpsrmonth ORDER BY SupplierLcc";
$rs_SupplierLcc = mysql_query($query_rs_SupplierLcc, $Verbindung) or die(mysql_error());
$row_rs_SupplierLcc = mysql_fetch_assoc($rs_SupplierLcc);
$totalRows_rs_SupplierLcc = mysql_num_rows($rs_SupplierLcc);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_LengthPart = "SELECT Distinct LengthPart FROM tblpsrmonth ORDER BY LengthPart";
$rs_LengthPart = mysql_query($query_rs_LengthPart, $Verbindung) or die(mysql_error());
$row_rs_LengthPart = mysql_fetch_assoc($rs_LengthPart);
$totalRows_rs_LengthPart = mysql_num_rows($rs_LengthPart);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_WidthPart = "SELECT Distinct WidthPart FROM tblpsrmonth ORDER BY WidthPart";
$rs_WidthPart = mysql_query($query_rs_WidthPart, $Verbindung) or die(mysql_error());
$row_rs_WidthPart = mysql_fetch_assoc($rs_WidthPart);
$totalRows_rs_WidthPart = mysql_num_rows($rs_WidthPart);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_Thickness = "SELECT Distinct ThicknessPart FROM tblpsrmonth ORDER BY ThicknessPart";
$rs_Thickness = mysql_query($query_rs_Thickness, $Verbindung) or die(mysql_error());
$row_rs_Thickness = mysql_fetch_assoc($rs_Thickness);
$totalRows_rs_Thickness = mysql_num_rows($rs_Thickness);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_Currency = "SELECT Distinct POCurrencyCode FROM tblpsrmonth ORDER BY POCurrencyCode";
$rs_Currency = mysql_query($query_rs_Currency, $Verbindung) or die(mysql_error());
$row_rs_Currency = mysql_fetch_assoc($rs_Currency);
$totalRows_rs_Currency = mysql_num_rows($rs_Currency);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_DrawingNo = "SELECT Distinct DrawingNo FROM tblpsrmonth ORDER BY DrawingNo";
$rs_DrawingNo = mysql_query($query_rs_DrawingNo, $Verbindung) or die(mysql_error());
$row_rs_DrawingNo = mysql_fetch_assoc($rs_DrawingNo);
$totalRows_rs_DrawingNo = mysql_num_rows($rs_DrawingNo);
mysql_select_db($database_Verbindung, $Verbindung);
$query_rs_Perforation = "SELECT Distinct Perforation FROM tblpsrmonth ORDER BY Perforation";
$rs_Perforation = mysql_query($query_rs_Perforation, $Verbindung) or die(mysql_error());
$row_rs_Perforation = mysql_fetch_assoc($rs_Perforation);
$totalRows_rs_Perforation = mysql_num_rows($rs_Perforation);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Unbenanntes Dokument</title>
<style type="text/css">
<!--
.Schrift {
font-family: Verdana, Geneva, sans-serif;
font-size: 9px;
font-style: normal;
background-color: #FFC;
}
.Schrift_green {
font-family: Verdana, Geneva, sans-serif;
font-size: 9px;
background-color: #DFDFDF;
}
.Schrift_tbl_search {
font-family: Verdana, Geneva, sans-serif;
font-size: 9px;
font-style: normal;
font-weight: bold;
background-color: #CCC;
}
-->
</style>
</head>
<body>
<form ID="myform" name="myform" method="post" action="Excel_liste.php"><br />
<table width="" border="0" cellpadding="0">
<tr>
<td width="69" class="Schrift">Partno</td>
<td width="144"><input name="mysearch" type="text" class="Schrift" id="mysearch"/></td>
<td width="77" class="Schrift">Geometry</td>
<td width="163"><label for="mysearch6"></label>
<select name="mysearch6" class="Schrift" id="mysearch6">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_Geometry['Geometry']?>"><?php echo $row_rs_Geometry['Geometry']?></option>
<?php
} while ($row_rs_Geometry = mysql_fetch_assoc($rs_Geometry));
$rows = mysql_num_rows($rs_Geometry);
if($rows > 0) {
mysql_data_seek($rs_Geometry, 0);
$row_rs_Geometry = mysql_fetch_assoc($rs_Geometry);
}
?>
</select></td>
<td width="77" class="Schrift">Mat.-Code</td>
<td width="147"><label for="mysearch12"></label>
<select name="mysearch12" class="Schrift" id="mysearch12">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_MatCodeManuf['MatCodeManuf']?>"><?php echo $row_rs_MatCodeManuf['MatCodeManuf']?></option>
<?php
} while ($row_rs_MatCodeManuf = mysql_fetch_assoc($rs_MatCodeManuf));
$rows = mysql_num_rows($rs_MatCodeManuf);
if($rows > 0) {
mysql_data_seek($rs_MatCodeManuf, 0);
$row_rs_MatCodeManuf = mysql_fetch_assoc($rs_MatCodeManuf);
}
?>
</select></td>
<td width="80" class="Schrift">Length</td>
<td width="144"><label for="mysearch18">
<select name="mysearch18" class="Schrift" id="mysearch18">
<?php
do {
?>
<option value="<?php echo $row_rs_LengthPart['LengthPart']?>"<?php if (!(strcmp($row_rs_LengthPart['LengthPart'], $row_rs_WidthPart['WidthPart']))) {echo "selected=\"selected\"";} ?>><?php echo $row_rs_LengthPart['LengthPart']?></option>
<?php
} while ($row_rs_LengthPart = mysql_fetch_assoc($rs_LengthPart));
$rows = mysql_num_rows($rs_LengthPart);
if($rows > 0) {
mysql_data_seek($rs_LengthPart, 0);
$row_rs_LengthPart = mysql_fetch_assoc($rs_LengthPart);
}
?>
</select>
</label></td>
<td width="68" class="Schrift">Width</td>
<td width="164"><label for="mysearch19">
<select name="mysearch19" class="Schrift" id="mysearch19">
<?php
do {
?>
<option value="<?php echo $row_rs_WidthPart['WidthPart']?>"<?php if (!(strcmp($row_rs_WidthPart['WidthPart'], $row_rs_LengthPart['LengthPart']))) {echo "selected=\"selected\"";} ?>><?php echo $row_rs_WidthPart['WidthPart']?></option>
<?php
} while ($row_rs_WidthPart = mysql_fetch_assoc($rs_WidthPart));
$rows = mysql_num_rows($rs_WidthPart);
if($rows > 0) {
mysql_data_seek($rs_WidthPart, 0);
$row_rs_WidthPart = mysql_fetch_assoc($rs_WidthPart);
}
?>
</select>
</label></td>
</tr>
<tr>
<td class="Schrift">Supplier</td>
<td><label for="mysearch1"></label>
<label for="mysearch1"></label>
<select name="mysearch1" class="Schrift" id="mysearch1">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_Supplier['SupplierName']?>"><?php echo $row_rs_Supplier['SupplierName']?></option>
<?php
} while ($row_rs_Supplier = mysql_fetch_assoc($rs_Supplier));
$rows = mysql_num_rows($rs_Supplier);
if($rows > 0) {
mysql_data_seek($rs_Supplier, 0);
$row_rs_Supplier = mysql_fetch_assoc($rs_Supplier);
}
?>
</select></td>
<td class="Schrift">Category</td>
<td><label for="mysearch7"></label>
<select name="mysearch7" class="Schrift" id="mysearch7">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_LabelCategory['LabelCategory']?>"><?php echo $row_rs_LabelCategory['LabelCategory']?></option>
<?php
} while ($row_rs_LabelCategory = mysql_fetch_assoc($rs_LabelCategory));
$rows = mysql_num_rows($rs_LabelCategory);
if($rows > 0) {
mysql_data_seek($rs_LabelCategory, 0);
$row_rs_LabelCategory = mysql_fetch_assoc($rs_LabelCategory);
}
?>
</select></td>
<td class="Schrift">Adhesive</td>
<td><label for="mysearch13"></label>
<select name="mysearch13" class="Schrift" id="mysearch13">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_Adhesive['Adhesive']?>"><?php echo $row_rs_Adhesive['Adhesive']?></option>
<?php
} while ($row_rs_Adhesive = mysql_fetch_assoc($rs_Adhesive));
$rows = mysql_num_rows($rs_Adhesive);
if($rows > 0) {
mysql_data_seek($rs_Adhesive, 0);
$row_rs_Adhesive = mysql_fetch_assoc($rs_Adhesive);
}
?>
</select></td>
<td class="Schrift">Thickness</td>
<td><label for="mysearch20">
<select name="mysearch20" class="Schrift" id="mysearch20">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_Thickness['ThicknessPart']?>"><?php echo $row_rs_Thickness['ThicknessPart']?></option>
<?php
} while ($row_rs_Thickness = mysql_fetch_assoc($rs_Thickness));
$rows = mysql_num_rows($rs_Thickness);
if($rows > 0) {
mysql_data_seek($rs_Thickness, 0);
$row_rs_Thickness = mysql_fetch_assoc($rs_Thickness);
}
?>
</select>
</label></td>
<td class="Schrift"> </td>
<td><label for="mysearch21"></label></td>
</tr>
<tr>
<td class="Schrift">Plant</td>
<td><label for="mysearch2"></label> <select name="mysearch2" class="Schrift" id="mysearch2">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_Plant['Plant']?>"><?php echo $row_rs_Plant['Plant']?></option>
<?php
} while ($row_rs_Plant = mysql_fetch_assoc($rs_Plant));
$rows = mysql_num_rows($rs_Plant);
if($rows > 0) {
mysql_data_seek($rs_Plant, 0);
$row_rs_Plant = mysql_fetch_assoc($rs_Plant);
}
?>
</select> <label for="mysearch2"></label></td>
<td class="Schrift">Material</td>
<td><label for="mysearch8"></label>
<select name="mysearch8" class="Schrift" id="mysearch8">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_LabelMaterial['LabelMaterial']?>"><?php echo $row_rs_LabelMaterial['LabelMaterial']?></option>
<?php
} while ($row_rs_LabelMaterial = mysql_fetch_assoc($rs_LabelMaterial));
$rows = mysql_num_rows($rs_LabelMaterial);
if($rows > 0) {
mysql_data_seek($rs_LabelMaterial, 0);
$row_rs_LabelMaterial = mysql_fetch_assoc($rs_LabelMaterial);
}
?>
</select></td>
<td class="Schrift">Color RAL</td>
<td><label for="mysearch14"></label>
<select name="mysearch14" class="Schrift" id="mysearch14">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_ColorRal['ColorRal']?>"><?php echo $row_rs_ColorRal['ColorRal']?></option>
<?php
} while ($row_rs_ColorRal = mysql_fetch_assoc($rs_ColorRal));
$rows = mysql_num_rows($rs_ColorRal);
if($rows > 0) {
mysql_data_seek($rs_ColorRal, 0);
$row_rs_ColorRal = mysql_fetch_assoc($rs_ColorRal);
}
?>
</select></td>
<td class="Schrift">Year</td>
<td><label for="mysearch20"></label></td>
<td class="Schrift">Currency</td>
<td><select name="mysearch21" class="Schrift" id="mysearch21">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_Currency['POCurrencyCode']?>"><?php echo $row_rs_Currency['POCurrencyCode']?></option>
<?php
} while ($row_rs_Currency = mysql_fetch_assoc($rs_Currency));
$rows = mysql_num_rows($rs_Currency);
if($rows > 0) {
mysql_data_seek($rs_Currency, 0);
$row_rs_Currency = mysql_fetch_assoc($rs_Currency);
}
?>
</select></td>
</tr>
<tr>
<td class="Schrift">Region</td>
<td><label for="mysearch3"></label>
<select name="mysearch3" class="Schrift" id="mysearch3">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_Region['Region']?>"><?php echo $row_rs_Region['Region']?></option>
<?php
} while ($row_rs_Region = mysql_fetch_assoc($rs_Region));
$rows = mysql_num_rows($rs_Region);
if($rows > 0) {
mysql_data_seek($rs_Region, 0);
$row_rs_Region = mysql_fetch_assoc($rs_Region);
}
?>
</select></td>
<td class="Schrift">Testspec.</td>
<td><label for="mysearch9"></label>
<select name="mysearch9" class="Schrift" id="mysearch9">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_TestSpec['TestSpec']?>"><?php echo $row_rs_TestSpec['TestSpec']?></option>
<?php
} while ($row_rs_TestSpec = mysql_fetch_assoc($rs_TestSpec));
$rows = mysql_num_rows($rs_TestSpec);
if($rows > 0) {
mysql_data_seek($rs_TestSpec, 0);
$row_rs_TestSpec = mysql_fetch_assoc($rs_TestSpec);
}
?>
</select></td>
<td class="Schrift">Color Pantone</td>
<td><label for="mysearch15"></label>
<select name="mysearch15" class="Schrift" id="mysearch15">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_Pantone['ColorPantone']?>"><?php echo $row_rs_Pantone['ColorPantone']?></option>
<?php
} while ($row_rs_Pantone = mysql_fetch_assoc($rs_Pantone));
$rows = mysql_num_rows($rs_Pantone);
if($rows > 0) {
mysql_data_seek($rs_Pantone, 0);
$row_rs_Pantone = mysql_fetch_assoc($rs_Pantone);
}
?>
</select></td>
<td class="Schrift">Spend</td>
<td> </td>
<td class="Schrift">Volume</td>
<td> </td>
</tr>
<tr>
<td class="Schrift">Productline</td>
<td><label for="mysearch4"></label>
<select name="mysearch4" class="Schrift" id="mysearch4">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_ProductLine['ProductLine']?>"><?php echo $row_rs_ProductLine['ProductLine']?></option>
<?php
} while ($row_rs_ProductLine = mysql_fetch_assoc($rs_ProductLine));
$rows = mysql_num_rows($rs_ProductLine);
if($rows > 0) {
mysql_data_seek($rs_ProductLine, 0);
$row_rs_ProductLine = mysql_fetch_assoc($rs_ProductLine);
}
?>
</select></td>
<td class="Schrift">Deliveryspec.</td>
<td><label for="mysearch10"></label>
<select name="mysearch10" class="Schrift" id="mysearch10">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_DeliverySpec['DeliverySpec']?>"><?php echo $row_rs_DeliverySpec['DeliverySpec']?></option>
<?php
} while ($row_rs_DeliverySpec = mysql_fetch_assoc($rs_DeliverySpec));
$rows = mysql_num_rows($rs_DeliverySpec);
if($rows > 0) {
mysql_data_seek($rs_DeliverySpec, 0);
$row_rs_DeliverySpec = mysql_fetch_assoc($rs_DeliverySpec);
}
?>
</select></td>
<td class="Schrift">Warntext</td>
<td><label for="mysearch16"></label>
<select name="mysearch16" class="Schrift" id="mysearch16">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_Warntext['Warntext']?>"><?php echo $row_rs_Warntext['Warntext']?></option>
<?php
} while ($row_rs_Warntext = mysql_fetch_assoc($rs_Warntext));
$rows = mysql_num_rows($rs_Warntext);
if($rows > 0) {
mysql_data_seek($rs_Warntext, 0);
$row_rs_Warntext = mysql_fetch_assoc($rs_Warntext);
}
?>
</select></td>
<td class="Schrift">Drawing No.</td>
<td><select name="mysearch22" class="Schrift" id="mysearch22">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_DrawingNo['DrawingNo']?>"><?php echo $row_rs_DrawingNo['DrawingNo']?></option>
<?php
} while ($row_rs_DrawingNo = mysql_fetch_assoc($rs_DrawingNo));
$rows = mysql_num_rows($rs_DrawingNo);
if($rows > 0) {
mysql_data_seek($rs_DrawingNo, 0);
$row_rs_DrawingNo = mysql_fetch_assoc($rs_DrawingNo);
}
?>
</select></td>
<td class="Schrift">Perforation</td>
<td><select name="mysearch23" class="Schrift" id="mysearch23">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_Perforation['Perforation']?>"><?php echo $row_rs_Perforation['Perforation']?></option>
<?php
} while ($row_rs_Perforation = mysql_fetch_assoc($rs_Perforation));
$rows = mysql_num_rows($rs_Perforation);
if($rows > 0) {
mysql_data_seek($rs_Perforation, 0);
$row_rs_Perforation = mysql_fetch_assoc($rs_Perforation);
}
?>
</select></td>
</tr>
<tr>
<td class="Schrift">ProductGroup</td>
<td><label for="mysearch5"></label>
<select name="mysearch5" class="Schrift" id="mysearch5">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_ProductGroup['ProductGroup']?>"><?php echo $row_rs_ProductGroup['ProductGroup']?></option>
<?php
} while ($row_rs_ProductGroup = mysql_fetch_assoc($rs_ProductGroup));
$rows = mysql_num_rows($rs_ProductGroup);
if($rows > 0) {
mysql_data_seek($rs_ProductGroup, 0);
$row_rs_ProductGroup = mysql_fetch_assoc($rs_ProductGroup);
}
?>
</select></td>
<td class="Schrift">Materialspec.</td>
<td><label for="mysearch11"></label>
<select name="mysearch11" class="Schrift" id="mysearch11">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_MatSpec['MatSpec']?>"><?php echo $row_rs_MatSpec['MatSpec']?></option>
<?php
} while ($row_rs_MatSpec = mysql_fetch_assoc($rs_MatSpec));
$rows = mysql_num_rows($rs_MatSpec);
if($rows > 0) {
mysql_data_seek($rs_MatSpec, 0);
$row_rs_MatSpec = mysql_fetch_assoc($rs_MatSpec);
}
?>
</select></td>
<td class="Schrift">LCC</td>
<td><label for="mysearch17"></label>
<select name="mysearch17" class="Schrift" id="mysearch17">
<option value="">Please Choose</option>
<?php
do {
?>
<option value="<?php echo $row_rs_SupplierLcc['SupplierLcc']?>"><?php echo $row_rs_SupplierLcc['SupplierLcc']?></option>
<?php
} while ($row_rs_SupplierLcc = mysql_fetch_assoc($rs_SupplierLcc));
$rows = mysql_num_rows($rs_SupplierLcc);
if($rows > 0) {
mysql_data_seek($rs_SupplierLcc, 0);
$row_rs_SupplierLcc = mysql_fetch_assoc($rs_SupplierLcc);
}
?>
</select></td>
<td class="Schrift"> </td>
<td> </td>
<td class="Schrift"> </td>
<td> </td>
</tr>
</table>
<p>
<input type="submit" name="button" id="button" value="Search" />
<input type="reset" name="button_reset" id="button_reset" value="Reset"/>
</p>
</form>
</body>
</html>
<?php
mysql_free_result($rs_Search);
mysql_free_result($rs_Plant);
mysql_free_result($rs_Supplier);
mysql_free_result($rs_Region);
mysql_free_result($rs_ProductLine);
mysql_free_result($rs_ProductGroup);
mysql_free_result($rs_Geometry);
mysql_free_result($rs_LabelCategory);
mysql_free_result($rs_LabelMaterial);
mysql_free_result($rs_TestSpec);
mysql_free_result($rs_DeliverySpec);
mysql_free_result($rs_MatSpec);
mysql_free_result($rs_MatCodeManuf);
mysql_free_result($rs_Adhesive);
mysql_free_result($rs_ColorRal);
mysql_free_result($rs_Pantone);
mysql_free_result($rs_Warntext);
mysql_free_result($rs_SupplierLcc);
mysql_free_result($rs_LengthPart);
mysql_free_result($rs_WidthPart);
mysql_free_result($rs_Thickness);
mysql_free_result($rs_Currency);
mysql_free_result($rs_DrawingNo);
mysql_free_result($rs_Perforation);
?>
Code Excel_liste.php PHP-Code: <?php require_once('Connections/Verbindung.php'); ?>
<?php
$mysearchkey = $_POST['mysearch'];
$mysearchkey1 = $_POST['mysearch1'];
$mysearchkey2 = $_POST['mysearch2'];
$mysearchkey3 = $_POST['mysearch3'];
$mysearchkey4 = $_POST['mysearch4'];
$mysearchkey5 = $_POST['mysearch5'];
$mysearchkey6 = $_POST['mysearch6'];
$mysearchkey7 = $_POST['mysearch7'];
$mysearchkey8 = $_POST['mysearch8'];
$mysearchkey9 = $_POST['mysearch9'];
$mysearchkey10 = $_POST['mysearch10'];
$mysearchkey11 = $_POST['mysearch11'];
$mysearchkey12 = $_POST['mysearch12'];
$mysearchkey13 = $_POST['mysearch13'];
$mysearchkey14 = $_POST['mysearch14'];
$mysearchkey15 = $_POST['mysearch15'];
$mysearchkey16 = $_POST['mysearch16'];
$mysearchkey17 = $_POST['mysearch17'];
$mysearchkey18 = $_POST['mysearch18'];
$mysearchkey19 = $_POST['mysearch19'];
$mysearchkey20 = $_POST['mysearch20'];
$mysearchkey21 = $_POST['mysearch21'];
$mysearchkey22 = $_POST['mysearch22'];
$mysearchkey23 = $_POST['mysearch23'];
$query_text = "SELECT * FROM tblpsrmonth WHERE ((PartNo LIKE '%$mysearchkey%') AND (SupplierName Like '%$mysearchkey1%') AND (Plant Like '%$mysearchkey2%') AND (Region Like '%$mysearchkey3%') AND (ProductLine Like '%$mysearchkey4%') AND (ProductGroup Like '%$mysearchkey5%') AND (Geometry Like '%$mysearchkey6%') AND (LabelCategory Like '%$mysearchkey7%') AND (LabelMaterial Like '%$mysearchkey8%') AND (TestSpec Like '%$mysearchkey9%') AND (DeliverySpec Like '%$mysearchkey10%') AND (MatSpec Like '%$mysearchkey11%') AND (MatCodeManuf Like '%$mysearchkey12%') AND (Adhesive Like '%$mysearchkey13%') AND (ColorRal Like '%$mysearchkey14%') AND (ColorPantone Like '%$mysearchkey15%') AND (Warntext Like '%$mysearchkey16%') AND (SupplierLcc Like '%$mysearchkey17%') AND (LengthPart Like '%$mysearchkey18%') AND (WidthPart Like '%$mysearchkey19%') AND (ThicknessPart Like '%$mysearchkey20%') AND (POCurrencyCode Like '%$mysearchkey21%') AND (DrawingNo Like '%$mysearchkey22%') AND (Perforation Like '%$mysearchkey23%'))";
header("Content-Type: application/vnd.ms-excel");
header("Content-Disposition: inline; filename=\"Report.xls\"");
$db_link = mysql_connect($hostname_Verbindung, $username_Verbindung, $password_Verbindung);
mysql_select_db($database_Verbindung, $db_link);
$result = mysql_query($query_text, $db_link);
$fieldcounts = mysql_num_fields($result);
for($i = 0; $i < $fieldcounts; $i++) {
$fieldtype = mysql_fetch_field($result, $i);
if ($i < ($fieldcounts-1)) echo "$fieldtype->name [$fieldtype->type]\t";
else echo "$fieldtype->name [$fieldtype->type]\n";
}
$myrow = mysql_fetch_array($result);
do {
for($i = 0; $i < $fieldcounts; $i++) {
$fieldname = mysql_field_name($result, $i);
if ($i < ($fieldcounts-1)) echo $myrow[$fieldname] . "\t";
else echo $myrow[$fieldname] . "\n";
}
} while ($myrow = mysql_fetch_array($result));
?> Hoffe aus Hilfe von Euch
Gruß
Frank |