Ok so i am trying to use a variable i set in side pdo update i echo out all of the variable which are in the pdo update and all are set but the update does not seem to work.... I think im just missing single / double quotes
$myName = mysql_real_escape_string($_POST['myName']);
$mydropdown = mysql_real_escape_string($_POST['mydropdown']);
if ($mydropdown == '1') {$tablename = "poke1";}
if ($mydropdown == '2') {$tablename = "poke2";}
if ($mydropdown == '3') {$tablename = "poke3";}
if ($mydropdown == '4') {$tablename = "poke4";}
if ($mydropdown == '5') {$tablename = "poke5";}
if ($mydropdown == '6') {$tablename = "poke6";}
echo $tablename;
$sqll = "UPDATE users SET '$tablename'=? WHERE username=?";
$q = $db->prepare($sqll);
$q->execute(array($myName,$_SESSION['username']));
Also i have echoed out the tablename and the myName both are vaild and set to the correct thing