I've spent the past month to get this small project to work and other than that, I have nothing to do with PHP. So, in order to fix a few small issues, I really don't want to learn coding in PHP. That's why I made a gamble and post it here. Thank you for your time and your tip!
imbruceter
Posts
-
How to get saved data from option select in PHP? -
How to get saved data from option select in PHP?Thank you for your answer! I have read on many pages about this issue, but not gonna lie, this looks like chinese for me. I'm uploading the data to the phpmyadmin database through this line:
$category_query = "SELECT * FROM categories";
$categories = mysqli_query($connection, $category_query);
if (isset($_GET['id'])) {
$id = filter_var($_GET['id'], FILTER_SANITIZE_NUMBER_INT);
} -
How to get saved data from option select in PHP?I'm quite new to PHP. I have a selection dropdown, which sends the data to the phpmyadmin database. This works fine, but I'd like it to be selected as default when I'm opening it again. Here is how my code currently looks like:
What I have tried:
I basically just inserted "selected" into it, but it's not the correct way, because every single option is shown as "selected". Here is an image about the frontend: https://i.imgur.com/I2cXYrN.png[^] Does anyone know how to make it to work? Thank you for being here! :)