如何从多输入字段创建搜索 [英] How do I creat search from multi input field

查看:88
本文介绍了如何从多输入字段创建搜索的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在多输入字段的数据库表中创建搜索

我有一个包含许多列的表,其中一些是类别子类别评估。 ..

用户从下拉类别中选择一个评估5所有类别a与进化5应该出现如果选择其他输入像子类别搜索更具体,这个下拉列表有来自数据库的数据我尝试这样做但没有结果可以帮助我这个我的代码



我尝试过:



How to create search in a table on database from multi input field
i have a table with many columns some of this is category subcategory evaluation. ..
user select from a drop down category a evaluation 5 all categories a with evolution 5 should appear if select other input like subcategory the search is more specifie and this drop down have data from database I try to do this but no results can you help me this my code

What I have tried:

<?php
if(isset($_POST['submit'])) {         
    $RelatedCustome=$_POST['txt_RelatedCustomer'];
    $LevelofPriority=$_POST['txt_LevelofPriority'];
    $category=$_POST['txt_category'];
    $subcategories=$_POST['txt_subcategories'];
    $ProductOrService=$_POST['txt_ProductOrService'];
    $CompanyName=$_POST['txt_CompanyName'];
    $Namecontactperson=$_POST['txt_Namecontactperson'];
    $evaluation=$_POST['txt_evaluation'];
    $sql=mysqli_query($conn,"select * from tbl_subcontractor where db_RelatedCustome='$RelatedCustome' or db_LevelofPriority='$LevelofPriority' or db_Category='$category' or db_Subcategories='$subcategories' or db_ProductOrService='$ProductOrService' or db_CompanyName='$CompanyName' or db_Namecontactperson='$Namecontactperson' or db_evaluation='$evaluation'" )or die(mysqli_error($conn));
    echo"<table class>";
echo"<table><tbody><tr>";
  echo" <td style>Related Customer
        <td style>Level of Priority
        <td style>Category
        <td style>Subcategory
        <td style>Product Or Service
        <td style>Company Name
        <td style>Name contact person
        <td style>Evaluation
        ";
 echo"</tr></tbody></table>";

    while($res=mysqli_fetch_array($sql)){
    $RelatedCustome=$res['db_RelatedCustome'];
    $LevelofPriority=$res['db_LevelofPriority'];
    $category=$res['db_Category'];
    $subcategories=$res['db_Subcategories'];
    $ProductOrService=$res['db_ProductOrService'];
    $CompanyName=$res['db_CompanyName'];
    $Namecontactperson=$res['db_Namecontactperson'];
    $evaluation=$res['db_evaluation'];
    echo"<table><tbody><tr>";
echo"<td >"; echo $RelatedCustome; echo"";
echo"<td >"; echo $LevelofPriority; echo"";
echo"<td>"; echo  $category; echo"</td>";
echo"<td >"; echo $subcategories; echo"";
echo"<td >"; echo $ProductOrService; echo"";
echo"<td >"; echo $CompanyName; echo"";
echo"<td >"; echo $Namecontactperson; echo"";
echo"<td>"; echo $evaluation; echo"</td>";
echo"</tr></tbody></table>";
        } echo"";
     }

推荐答案

_POST [' submit'])){
_POST['submit'])) {              


RelatedCustome =
RelatedCustome=


_POST [' txt_RelatedCustomer'];
_POST['txt_RelatedCustomer'];     


这篇关于如何从多输入字段创建搜索的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆