So I’m trying to do something really basic with an SQL command but it needs a WHERE clause in it. The reason is because a previous page with a grid on it is sending this page a value for an ID. So this is sort of the example:
$g->select_command = “SELECT * FROM my_table WHERE myid=$myid”;
No matter what I do, the $myid value is ignored. I’m figuring the WHERE clause is being knocked out and I’m getting an error or no records. I know the value is getting there, and if I replace the $myid with a value like “1” it works which is even more strange. Any thoughts or suggestions since these are $_POST variables being pushed to the page.
Hi,
You can refer this faq:
https://www.gridphp.com/docs/misc-faqs/#q-how-to-load-grid-based-on-_post-data-from-other-page
We are in Asia/pk, if you still have issues, I will be updating back in working hours.
Please let me know if you need further help.
I’m having the exact same problem, and getting no where. I’ve created the $_SESSION variable and then the $pid variable as suggested here. I just keep getting the same error. I wondering if I’m calling the $_SESSION variable in the wrong location or something similar, it’s just making no sense.
<script src=”https://gist.github.com/bruceits/91e50f1fb3340c6ca41c62142cab88bf.js”></script>
This is the location of the source, looks like my last post screwed up:
https://gist.github.com/bruceits/91e50f1fb3340c6ca41c62142cab88bf
Hi,
Try changing line 16-19 with:
// get the oemid from the Post
$oemid = filter_input(INPUT_POST, 'oemid', FILTER_SANITIZE_NUMBER_INT);
if (!empty($oemid)) $_SESSION['oemid'] = $oemid;