-1

I am trying to make a search form (which will be best to be with drop down menu) with values from column CUST_BULSTAT and to fetch a single row data that will be printed into a text template document.

On this stage I am connecting to database and fetch some data. But this should be made by search form

My code is as follows

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8" />
        <title></title>
    </head>
    <body>
<form action="" method="post">  
<input type="text" name="search" /><br />  
<input type="submit" value="Submit" />  
</form>
<?php
$host = 'localhost:C:\Program Files (x86)\Firebird\Firebird_2_5\bin\Service.gdb';
$username = 'SYSDBA';
$password = 'masterkey';
$dbh = ibase_connect("localhost:C:\Program Files (x86)\Firebird\Firebird_2_5\bin\Service.gdb","SYSDBA", "masterkey", "UTF-8") or die('die message');
$search = s($_REQUEST['search']);    
    $q = ibase_query($dbh, "select * from CUSTOMERS WHERE CUST_BULSTAT LIKE '%".$search."%'");
    while ($row = ibase_fetch_object($q)) {
        echo $row->CUST_BULSTAT, "<br>";
        echo $row->CUST_MANAGERNAME, "<br>";
        echo $row->CUST_TOWN, "<br>";
        echo $row->CUST_STREET, "<br>";     
    }
ibase_free_result($q);
ibase_close($dbh);
?>  
    </body>
</html>

With best regards Valentin

ascripter
  • 5,665
  • 12
  • 45
  • 68
Ombre
  • 1

1 Answers1

0

My question is how can I made a search form with drop-down list from where are listed values from column CUST_BULSTAT of table CUSTOMERS and when check one of them to extract from database a entire row of data where CUST_BULSTAT is same with those I selected in the drop down menu.

Hope its more clear now

Best regards Valentin

Ombre
  • 1