Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
User defined search criteria for DB
Name: drew22299 Date: May 15, 2007 at 02:34:05 Pacific OS: xp sp2 CPU/Ram: 2,000 mhz 512mb Product: n/a
Comment:
Can anyone show me in basic php or asp how to allow a user to enter keywords into a text field and have the database return entries with the keyword they typed in?
I know the SQL for it, but how do you define a variable that will store the keyword the user enters and how do you put it into the SQL query? Please help!
Name: Michael J (by mjdamato) Date: May 15, 2007 at 09:19:41 Pacific
Reply:
Well, let's say you have a form with a field for the user to enter in the last name. We'll assume the name of the field is last_name.
In PHP on the page that receives the form input you can access the value of what was entered via $_POST['last_name']. So, just take that variable an put it into your query:
$query = "SELECT FROM table WHERE last_name LIKE '%$_POST['last_name']%'";
Summary: Currently there are thousands of search engines available on internet. Among them Google, Yahoo, MSN are top three search engines in today’s date. Each of them having their own search criteria. And ...
Summary: I'm not entirely sure on how the process works, but I think the major search engines take snapshots of websites using the data found in <meta keywords... tags and store it in a database. When a pe...
Summary: Does anyone know of a search engine that will work well with an already existing Content Management System (CMS)? I need to be able to allow users to look up products on my site, but the one provided ...