I have a simple market and user customisation system, when a user equips an item it goes to (URL)/render.php?id=item ID , in the render.php file it has simple code found below. How would I make the file check if the user actually owns the item before equiping it? (at the moment it doesn't and you can wear stuff you don't own by abusing that)
<? include "../../header.php";
$id = $_GET['id'];
$item = $handler->query("SELECT * FROM items WHERE id=" . $_GET['id']);
$gI = $item->fetch(PDO::FETCH_OBJ);
$handler->query("UPDATE `users` SET `$gI->type`='$gI->wearable' WHERE `id`='$myu->id'");
?>
<head><meta http-equiv="refresh" content="1; url=/Customize/"></head>