I trying to update my db using a PDO statement, I have had no real problems until I try to update it using variables as the name and field .
$real_function = 'top' ;
$value = 99 ;
$tableName = "twitter_control" ;
$stmt = $pdo->prepare("UPDATE ? SET ?=? WHERE id='control' ");
$stmt->execute(array( $tableName, $real_function, $value ));
If I use this code all works as expected
$stmt = $pdo->prepare("UPDATE twitter_control SET top=? WHERE id='control' ");
$stmt->execute(array( $value ));
How can I make this work ? , any suggestions please ?