how may I integrate an url-parameter for instance "123" into the select
From this code:
$g->select_command = "SELECT * FROM `t` where id = 123; ";
to a code like this:
' "$g->select_command = "SELECT * from t where id =". $_GET["ref_id"]. ";"';
Or is this not not possible having a flexible id in the select command?
Ideally $_GET should work as it is. But you can try the following:
$_SESSION["ref_id"] = $_GET["ref_id"];
and use `$ref_id` in your SQL.
Thank you. The standard case works.
But the referrer-id is only kept with the first click. As soon as the second click is there the message appears:
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 ref_id = '
This means at the second click the ref_id is empty. Is there a possibility to keep the id over the whole session, or is there a possibility to errorhandle an error like "Couldn't execute query." to a redirect?
thanx and best regards,
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?