How do I execute a SQL query with a variable as table? I have a dropdown menu in HTML and want the chosen option to be the table name. But as I now query
$klas = $_POST['klasDown'];
$query = 'INSERT INTO $klas
gives me the error message:
Fatal error: Uncaught exception 'mysqli_sql_exception' with message 'Table 'izandb.$klas' doesn't exist'
EDIT: Why has this been closed that quickly? I dont really is the same question as is being said to be a duplicate of