it's me again.
I am trying to make a dropdown menu that will request it's data from a MySQL database (rows: category_id(a_i), category
) and display it in the dropdown menu. When new rows are added, the dropdown menu should expand to house them. This is the code I've created so far:
<select>
<select name="submit" id="category">
<option>Select category</option>
<?php
$query=$db->prepare("SELECT * FROM categories");
$query->execute();
while($rows=mysql_fetch_array($query)){
?>
<option value="<?php echo $rows['']; ?>"></option>
<?php
}
?>
</select>
db variable:
<?php
$db =mysqli_connect('localhost','xxx','xxx','xxx') or die('error with connection');
?>
However this code displays this error that I'm unable to fix on my own: Call to undefined method mysqli::mysqli_query()