sundance1980
MIS
Hello I am executing the following query via a post.
I then do some calculations so that each page only show 5 results per page.
I created links such as 5|10|15| like this:
The problem I think I have is that when I click on results 10 php loses $_POST["user_input"] $_POST["searchtype"] from the previous page. At the bottom of the web browser status bar it shows the following when I hover the link 10.
And when I click on it I get the following error...
"No results found matching your query - SELECT * from news WHERE LIKE '%%' ORDER BY id DESC;"
My question is what is 'ub%' and is my search string '%".$_POST["user_input"]."% being lost in limbo?
thanks for the advice or idea in advance. Thanks.
Code:
$query = "SELECT * FROM news WHERE ".$_POST["searchtype"] ." LIKE '%".$_POST["user_input"]."%' ORDER BY id DESC;";
I then do some calculations so that each page only show 5 results per page.
I created links such as 5|10|15| like this:
Code:
<a href="<?=$PHP_SELF?>?query=<?=$query?>&page=<?=$page?>&limit=10">10</a> |
The problem I think I have is that when I click on results 10 php loses $_POST["user_input"] $_POST["searchtype"] from the previous page. At the bottom of the web browser status bar it shows the following when I hover the link 10.
Code:
[URL unfurl="true"]http://www.foo.org/results.php?query=SELECT[/URL] * from news WHERE story LIKE 'ub%' ORDER BY id DESC;&page0&limit=10
And when I click on it I get the following error...
"No results found matching your query - SELECT * from news WHERE LIKE '%%' ORDER BY id DESC;"
My question is what is 'ub%' and is my search string '%".$_POST["user_input"]."% being lost in limbo?
thanks for the advice or idea in advance. Thanks.