I have no clue how to do this. I've looked up examples but it is all kind of vague for me using the @variable, I have no clue on what that is and how I can look up my answer.
I've got this variable $slotname
which can be weapon
or amulet
or anything.
In my database it is weapon_name
or amulet_name
thats why the ._name.
after the post
$slotname = $_POST['slot'].'_name';
$naam = 'Player1';
$sql = $db->prepare("SELECT @slotname FROM player WHERE naam = :naam");
$sql->execute(array(":naam" => $naam));
$fetch = $sql->fetch();
So in this case $slotname = weapon_name
and I want to select the column weapon_name
from the user Player1
but I have no clue how to do this.
Any tips?