Answer the question
In order to leave comments, you need to log in
An error in the php code, how to understand where?
There is an error somewhere in the code, I can not understand where?
if(!$db) {
echo 'ERROR: Could not connect to the database.';
} else {
if(isset($_POST['queryString'])) {
$queryString = $_POST['queryString'];
if(strlen($queryString) > 0) {
$query = $db->query("SELECT name FROM MS_store WHERE name LIKE '$queryString%' LIMIT 10");
if($query) {
while ($result = $query->fetch_object()) {
echo '</li><li onclick="fill(''.$result->value.'');
">'.$result->value.'</li>';
}
} else {
echo 'ERROR: There was a problem with the query.';
}
} else {
}
} else {
echo 'There should be no direct access to this script!';
}
}
Answer the question
In order to leave comments, you need to log in
not
a
syntax error, not escaped parentheses, and after the variable again as well in general
echo "</li><li onclick=\"fill( '{$result->value}');\">{$result->value}</li>";
even so
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question