Click here to Skip to main content
15,924,679 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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
<?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 $RelatedCustomeecho"";
echo"<td >"echo $LevelofPriorityecho"";
echo"<td>"echo  $categoryecho"</td>";
echo"<td >"echo $subcategoriesecho"";
echo"<td >"echo $ProductOrServiceecho"";
echo"<td >"echo $CompanyNameecho"";
echo"<td >"echo $Namecontactpersonecho"";
echo"<td>"echo $evaluationecho"</td>";
echo"</tr></tbody></table>";
        } echo"";
     }
Posted
Updated 5-Jun-16 17:01pm
v2
Comments
mhmd2991 7-Jun-16 1:06am    
any idea ??!!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900