Ich bekomme in einem DIV die Ausgabe von $response. Allerdings kann ich diese dann nicht anklicken, so das es in einem Input - Feld erscheint.
MySQL und MySQLi ist mir bekannt. Will es erst mal funktionstüchtig haben.
Danke!
MySQL und MySQLi ist mir bekannt. Will es erst mal funktionstüchtig haben.
Danke!
PHP-Code:
<?php
include("connect.php");
$q = $_GET['q'];
$sql = mysql_query ("SELECT ortsname FROM plz_ort_strassen WHERE ortsname LIKE '%$q%' LIMIT 1");
$i=0;
$hint = "";
while ($row = mysql_fetch_assoc($sql))
{
$hint.= "<font size=2>".$row['ortsname']."</font>";
}
if ($hint=="") {
$response="<font size=2>kein Eintrag vorhanden → $hint → $q</font>";
} else {
$response=$hint;
}
echo $response;
?>
Kommentar