Problem with a simple search engine in MySQLi SB
Hi!
I have a simple form that allows users to do searches such as registration number, or date ... things like that. Next the code of the form:
--
<form action="Result_Num_Matricula.php" method="get" name="F1">
<fieldset id="Search">
<input name="tmatricula" id="tmatricula"type="text" size="35" value=""<?php echo((isset($_GET["tmatricula"]))?$_GET["tmatricula"]:"") ?>>
<input type="submit" name="Buscar1" value="Buscar">
</fieldset>
</form>
--
"Result_Num_Matricula.php" is the page that processes the search and shows the results. I have this code:
--
<?php
$rsMatriculas = new WA_MySQLi_RS("rsMatriculas",$conexion,1);
$rsMatriculas->setQuery("SELECT * FROM matriculas WHERE matriculas.matriculas LIKE ? OR -1 = ? ORDER BY id DESC");
$rsMatriculas->bindParam("text", "".$_GET['tmatricula'] ."", "-1"); //tmatricula
$rsMatriculas->bindParam("text", "".$_GET['tmatricula'] ."", "-1"); //tematricula1
$rsMatriculas->execute();
?>
--
The question is that it behaves strangely when I try it: I enter a license plate number in the field "tmatricula" and it works but then I repeat again introducing another one and it stops working (it does not give results) ... I've been trying to solve it since yesterday and I can not find a way to do it.
Does anyone have an idea of how it can work?
Thank you. regards