1
I input an admin to write a message to a specific user. The user will be selected by a select that fetches the names from the user table and lists them all. After selecting someone, the admin can write the message, which would be saved in the comic with the "user" field that was previously selected.
$resultado = mysqli_query($ligacao, $sql);
while ($row = mysqli_fetch_assoc($result)) {
$rows[] = $row;
}
return $rows;
$rows = db_select("SELECT name FROM utilizadores");
if ($rows === false) {
$error = db_error();
echo $rows;
// Handle error - inform administrator, log to file, show error page, etc.
}
I’m not doing echo so I guess the query is wrong, and if not, how do I list the result in select? I suppose it’s inside the while loop like:
while ($row = mysqli_fetch_assoc($result)) {
$rows[] = $row;
?>
<select>
<option>$rows[]</option>
</select>
<?php
}
thanks! I’ve already made the select.
– João Alpoim