![]() |
Wishing I had hair to pull out...
This is probably a very simple question but I have spent hours searching the web and cannot find an answer.
I am pulling records from a mysql database with SELECT * FROM sheet WHERE value = value(passed from a url) This all works fine, but how on earth do I now get it to display all the records when I have WHERE cutting my options down. I have tried passing 1+2+3 etc in the url but nothing seems to work. I hope that makes sense. |
Code:
SELECT * FROM sheet |
Showing us snippet of your code helps us show you how to specifically do it with your code.
But without that I can give you a few basic examples In the following examples $rn could be the variable that you are passing from the url. PHP Code:
PHP Code:
PHP Code:
PHP Code:
There is also a way to do it with a class but that is likely beyond you at this time. So hope that helps. As a side note do to that high risk of SQL injections with passing variables from a URL I recommend you use mysql_real_escape_string() and htmlentities() as well as other security precautions. |
Do you still want to limit the result set? Assuming Xenon didn't answer your question, how about the following to limit the result set to just 1, 2 and 3:
sql Code:
|
Yes I want to be able to limit the results as well.
I have a jump menu which is carrying the value over, the 1,2,3 etc and lets me show an individual record just fine, the problem is with how to pass something from that menu to show all the records. The code that is doing the selecting (I think, in the beginner section for a reason;-) ) is PHP Code:
Hope that explains better |
| All times are GMT. The time now is 12:31 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0