Doesn’t that mean that your id field actually contains (1) and (2), as you don’t add those brackets in your display code but still get them in the display?
Maybe it’s a non-qwerty keyboard thing? special syntax? If it’s not comprehending the different uses for square brackets vs. angle brackets, please review until it becomes second nature.
Hey joon1, what is the data type of id in the database? It looks like your code should work, unless there’s no numeric id found that is equal to 2…
FWIW it looks like you are re-typing your code, because some of it doesn’t look like it would run (as others have mentioned). It’s better to copy/paste to avoid typos.
The code below has typos in it.
if ($sqlCount ] 0){
while ($row = mysqli_fetch_assoc($sqlt)) {
echo $row['id'] . ' ' . $row['name'].'[br]'; }
}
I think this is the code that should produce your first result?
if ($sqlCount > 0) {
while ($row = mysqli_fetch_assoc($sqlt)) {
echo '('.$row['id'] . ') ' . $row['name'].'<br>';
}
}