0
I have the following problem in PHP
, I’m doing a search in a bank Firebird
in order to be able to issue a report with the sales requests.
I will enter the order ID one by one and you will return the values. However, each time I do the research it eliminates the existing data, leaving only the last searched value.
<?php
$a = $_GET['a'];
if($a == "buscar"){
$id = $_POST['id'];
$sql = ibase_query("SELECT NOME FROM TB_CLIENTE WHERE ID_CLIENTE LIKE '%".$id."%'");
$row = ibase_fetch_row($sql);
echo '<tr>';
echo '<td>' . $row[0] . '</td>';
echo '<td>' . $id . '</td>';
echo '</tr>';
}
?>
Could someone help me ? (in Queries
is searching for the customer name only as example, then I will change to the order data, so it is easier to view)
I’m not sure but LIKE does not work in INTEGER data type. Try using "SELECT NAME FROM TB_CLIENTE WHERE ID_CLIENTE =". $id
– Sérginho
So he is searching for the data as I am requesting it normally. I guess I did not formulate the question well. The point is that when I do a new search, it should keep the first and display + the second, but it replaces the data of the first by the second, leaving only one line
– ProgMen
What are you getting in $_POST['id']? wouldn’t $_GET['id'] ?
– user50712
The question is not clear. What is a new search? Reload this PHP in the browser? If so, clear the screen is the expected behavior.
– bfavaretto
I agree the question was a little confused, I think I’ll close the topic, thanks to those who helped!
– ProgMen