This question already has an answer here:
I have mySQL tables namely q1 , q2 , q3 and so on....
now the following code is in loop with $n increasing with every step of loop.
$table = "q".$n;
$query="SELECT MAX(QNO) AS max2 FROM '$table'";
$q=mysqli_query($db,$query) or die("Error: ".mysqli_error($db));
$max2 = mysqli_fetch_array($q);
This gives me an error
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '"q1"' at line 1
How to solve this problem and putting new name of table everytime in the query?
</div>