I do this to query the Mysql database
$keyword = strval($_POST['query']);
$search_param = "{$keyword}%";
$conn =new mysqli('xxx', 'xxx', 'xxx' , 'xxx');
$sql = $conn->prepare("SELECT * FROM empresas WHERE nome LIKE ? or palavras_chave LIKE ?")
$sql->bind_param("s",$search_param);
$sql->execute();
$result = $sql->get_result();
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$countryResult[] = $row["nome"];
}
echo json_encode($countryResult);
}
$conn->close();
Just looking for the name, how would I look for another mysql column? Such as name and keywords .