Search bar, how do you code it?
|
Okay... Now i have a pretty stupid question here. How do you code a search bar using php codes? >_> I know I am pretty much an idiot but please, I really need help here! Thanks.
Loneliness have always been my friend...
Until the day I find you... |
Re: Search bar, how do you code it?
Link |
by
on 2006-08-01 10:11:25
|
To add a search feature to your page: 1. Create an HTML <form> (POST method) with one text input for typing the search parameter (lets call it 'query'), and a button to submit the form. 2. Use the PHP variable $_POST['query'] for your search. |
Re: Search bar, how do you code it?
|
Okay.... I am a complete newbie on php. So I have create a form but the problem is I can't get it to search every table(I am using mysql) I have for the query. What should I do?
Loneliness have always been my friend...
Until the day I find you... |
Re: Search bar, how do you code it?
Link |
by
on 2006-08-01 20:08:29
|
you might do a query like this after storing mysql_escape_string($_POST['query']) into $query:SELECT * FROM MyTable WHERE columnName LIKE '%$query%' |
Re: Search bar, how do you code it?
|
Okay... I will try. Thanks!! ^^
Loneliness have always been my friend...
Until the day I find you... |
Re: Search bar, how do you code it?
Link |
by
on 2006-08-01 23:37:39
|
as problems arise, as i am sure they will, keep posting here for help if you need it! |