No, this is *NOT* a "PHP syntax error".
It has nothing (directly) to do with PHP.
As the error message says, it is a MySQL
syntax error. Don't confuse the two!!
When you get a MySQL error, it is time to stop using PHP and use a MySQL database tool (e.g., myphpadmin or similar) to DEBUG your SQL code.
And you typically do that thus:
$sql = "SELECT * FROM '$tableone'";
echo "DEBUG SQL: " . $sql . "<hr/>]n"; // remove this when code starts working
$result = mysqli_query($mysqli_link, $sql ) or die(mysqli_error($mysqli_link));
If you did that, then you would see (in this case, only) the output
SELECT * FROM 'test'
And then you would copy/paste that SQL query into your database tool.
With any luck at all, you will then get a better diagnostic error message.
In this case, you would like get an error message like this:
ERROR 1064 (42000): 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 ''test'' at line 1
You will soon learn that this message puts '...' around your actual error. So when you see
you remove the outer apostrophes and you know that the error is in the code
I'll save you the trouble of browsing through the MYSQL docs: ANY time you put something in APOSTROPHES, that something becomes a *STRING* to MySQL.
And you can *NOT* select anything from a *STRING*.
You must select from a table NAME.
In other words, if you had simply done
you would not get that error!
*PROBABLY* you don't see the difference between apostrophes ('...') and back ticks (`...`). A ` back tick is the character that shares the keyboard key with the ~ tilde. And yes, MySQL allows you to put back ticks--*NOT* apostrophes--around table and field names.