php variable as table name for the grid SQL query

Questionsphp variable as table name for the grid SQL query
Tukur Dan-Asabe asked 2 years ago

I want to use php variable as table for the phpGrid as code shown below:

$getRange=$_POST[‘game’];

……
……

$g->select_command = “select * from $getRange ” ;
$g->table = ” $getRange “;

……
……

it keeps given errors as follows:

Couldn’t execute query. 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 ‘WHERE 1=1 LIMIT 1 OFFSET 0’ at line 1 – select * from WHERE 1=1 LIMIT 1 OFFSET 0

Your Answer

7 + 19 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?