For an update form I need to fetch singe rows so I created the query like this:
$item_id = $_GET['item_id'];
$content = $conn->query("SELECT * FROM menu_kaart_items
WHERE menu_kaart_item_id = '$item_id'");
To fetch the rows I used:
$row = $content->fetchAll(PDO::FETCH_ASSOC);
But my form fields that look like this:
<input name="menu_item" type="text" class="textfield" value="<?php echo $row->menu_item;?>">
dont return any results.
I used MYSQL before where I used:
$content = mysql_query("SELECT *
FROM menu_kaart_items
WHERE menu_kaart_item_id = '$item_id'");
$row = mysql_fetch_object($content);
which gave me the right results but many people here advised me to switch to PDO which I am working on right now but I can’t get my head arround this part.
What am I doing wrong?