thanks
search a table
Moderator: General Moderators
Re: search a table
a conditional statement? what something like a code that will only display the result codeing when u click the search button? sorry im confused, new to all this, i started at the deep end, going straight for a big script, should of started with a small 1 really 
thanks
thanks
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: search a table
Yes I think you are trying to run before you can walk. Which is not always bad if a developer understands the concepts from another language just not the syntax. Conditional statements are one of the first things a developer learns.
Yes you could fire the code after the submit button has been pressed. Therefore when the user comes to the page for the first time only the search boxes are shown. Then after the user has entered the search criteria then the form will be submit and the page will be reloaded and you can fire the rest of the code to do the search through the database and to display the results.
Yes you could fire the code after the submit button has been pressed. Therefore when the user comes to the page for the first time only the search boxes are shown. Then after the user has entered the search criteria then the form will be submit and the page will be reloaded and you can fire the rest of the code to do the search through the database and to display the results.
Re: search a table
ok cool thanks, will just have to try and work out the codeing for that now.... may take some time but i been lookin at the codes and trying to work something out for it...
thanks for the help, much appriciated
thanks for the help, much appriciated
Re: search a table
i have it sorted now, all done. i use a session, when you search, by pressing enter or search it sets a session variable, and the search results will only display when the variable is set, and then the variable is unset again once the code has been displayed. i have tested this code a number of times with different search strings and it seams to do the job.
thanks for the help
thanks for the help
- jaoudestudios
- DevNet Resident
- Posts: 1483
- Joined: Wed Jun 18, 2008 8:32 am
- Location: Surrey
Re: search a table
session is overkill. You are using a hammer to crack a nut! But if it works, who cares right? 
Re: search a table
yep it works, and i knew roughly how to do that. maybe in time ill figure out a different way of doing it, but for now it will do
thanks for all the help wiv this
Re: search a table
I must be mad... i thought about this the other day... i use a if(isset($_POST function to set the session, and then another if(isset function to check if the session is set or not.... why donti just use the original if(isset($_POST function on the mysql query in the first place? i have now changed the code, so that im not using the session anymore, and it works just the same... and it saves on space as it uses less code. I wish i had of thought of this first :S
Thanks for the help u gave me
Thanks for the help u gave me