Hi, I'm new to PHP/MySQL and need help please.
Basically I need to know how http://uk.mobile.de/cgi-bin/search.pl?b ... &sprache=2 or http://www.car.gr can search their database and have the 'any make' or 'any mileage' option set. What is the code for something like this?
Deeply appreciated.
Search Database, return records
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
First off, you don't use PHP to search the database you use PHP to run SQL queries.
Have a look at the mysql information on select to see how to construct a basic query:
http://www.mysql.com/doc/S/E/SELECT.html
Basically you want to have some conditions in the WHERE clause of the SELECT statement.
Mac
Have a look at the mysql information on select to see how to construct a basic query:
http://www.mysql.com/doc/S/E/SELECT.html
Basically you want to have some conditions in the WHERE clause of the SELECT statement.
Code: Select all
SELECT Make, Model, Color, Mileage FROM your_table WHERE Make = 'something' AND Model = 'something_else'