I have a form in which, when entering a license plate in the registration field, it lists the license plates. And each enrollment is related to a person and their data: name, date of birth, date of admission.
However, I need when I click on the registration, it will fill in the other fields on the form. And this part I'm not able to elaborate and execute.
This is the code that lists the registrations:
<?php
$host="localhost"; // Host name
$username="teste_inezb"; // Mysql username
$password=""; // Mysql password
$db_name="teste_login"; // Database name
$con = mysql_connect($host,$username,$password) or die(mysql_error());
mysql_select_db($db_name, $con) or die(mysql_error());
$q = strtolower($_GET["q"]);
if (!$q) return;
$sql = "select DISTINCT MATRIC from DBWEBCAD where MATRIC LIKE '%$q%'";
$rsd = mysql_query($sql);
while($rs = mysql_fetch_array($rsd)) {
$cmat = $rs['MATRIC'];
$cname = $rs ['NOMSCODEP'];
echo "$cmat\n", "$cname\n";
}
?>