Good afternoon, I have a problem, wanting to bring the data of the table where they were saved, I need to make a where the query with a parameter, here I post the query sample and the error I get:
$ g-> select_command = "SELECT * FROM Customers Where customer_id = $ ultimo_id";
Could not 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 'LIMIT 1 OFFSET 0' at line 1 – SELECT * FROM Customers Where customer_id = LIMIT 1 OFFSET 0
Stay tuned for your help, thank you very much.
To use post variables in query, you need to use sessions.
Q) How to load grid based on $_POST data from other page?
The grid is loaded with 2 server calls.
1) load the columns of grid.
2) do an ajax call, to load data of grid.
Now, if you want to pass data from external form, it is available for step1. But not there in 2nd ajax call, as it is not posted.
Solution is to put the POST variable in session and use it from session for step2.
$_SESSION["personid"] = $_POST["personid"];
$pid = $_SESSION["personid"];
and use `$pid` in your SQL.
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?