0
I’m doing a query in a database and I need to display the information on the screen, but searching one at a time. I tried to do by array, but it is not displaying the vector.
Code:
<?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);
$vetorDados = array();
$i=0;
$vetorDados[$i]= ibase_fetch_row($sql);
echo '<tr>';
echo '<td>' . $vetorDados[$i] . '</td>';
echo '<td>' . $i . '</td>';
echo '</tr>';
$i++;
}
?>
@Progmen I had forgotten to close to
tag </tr>
– WMomesso
So, earlier I was doing so, but then he searches "all" the names with aqele id, and if I look for another he erases the previous, I wanted him to be making a list as he would add
– ProgMen
See if I understand, you want to create a list as if it were a history of the last searched records?
– WMomesso
This, as I give more ids they will appear in order on the screen, the way I am doing, each value q I enter it erases the previous.
if($a == "buscar"){
 $id = $_POST['id'];
 $sql = ibase_query("SELECT NOME FROM TB_CLIENTE WHERE ID_CLIENTE = $id ");
 $row = ibase_fetch_row($sql);
 echo '<tr>';
 echo '<td>' . $row[0] . '</td>';
 echo '</tr>';
 }
– ProgMen
@Progmen understood, but this way is not possible using
php
for it to work that way you need to usejquery
orjavascript
creating a dynamic list in theinnerHTML
this way you must complete this question and create a new one, requesting assistance when creating a dynamic list ordered with search data.– WMomesso
Perfectly, thank you! Did not know haha, thought q php would do it. thank you.
– ProgMen
I’ll ask the question, can you help me through there ?
– ProgMen
Let’s go continue this discussion in chat.
– WMomesso