in einem Etikett mit der automatischen Vervollständigung in PHP eine der beiden Datenbankwerte anzuzeigen Dies ist mein Code ein:wie
<?php include("config.php");
include("session-user.php");
$term = trim(strip_tags($_GET['term']));//retrieve the search term that autocomplete sends
$qstring = "SELECT product_title, product_details, product_id FROM tbl_product WHERE product_title LIKE '".$term."%' OR product_details LIKE '".$term."' and is_delete = '0'";
$result = mysqli_query($con,$qstring);//query the database for entries containing the term
while ($row = mysqli_fetch_array($result))//loop through the retrieved values
{
$row['label']=htmlentities($row['product_title']);
$row['label']=htmlentities($row['product_details']);
$row['product_id']=htmlentities($row['product_id']);
$row_set[] = $row;//build an array
}
echo json_encode($row_set);
zur Zeit nur eines der labels
zeigt, möchte ich mit einem der beiden suchen Etiketten
Wie ich es erreichen kann?
aufgrund gleichen Indizes zunächst ein überschreiben, wie '$ row [ 'label'] = htmlentities ($ row [ 'Produktname']); $ row [ 'label1'] = htmlentities ($ row [ 'Produkt_Details']); 'überprüfen i –
Sekunden einen Index zu' label1' geändert haben nun ihr nicht die label1 Wert – Learner