View Single Post
Old 01-14-2007, 09:33 PM   #3 (permalink)
waveclaw
Recruit
 
waveclaw's Avatar
 
Join Date: Jul 2006
Location: USA
Posts: 19
waveclaw is on a distinguished road
Send a message via ICQ to waveclaw Send a message via AIM to waveclaw Send a message via MSN to waveclaw Send a message via Yahoo to waveclaw
Which DB?

Quote:
Originally Posted by markster View Post
i have a database of products
What kinda of a database? A MySQL database? sqlite? Postgresql? Oracle? If you have a relational database then you can use DJMaze's SQL (Structured Query Language) statement. PHP has support for SQL to access a number of databases.

Otherwise, as with a flat-file, you can look up any number of search algorithms online.

Be careful with accepting input from a user to search any database. If you directly run the search with input from the user then they can inject extra SQL into your search. These extra commands can possibly run any SQL operation on your database that your PHP system can, including deleting the whole database. Some database utility libraries may offer to handle this for you, like prepared statements, or completely ignore it forcing you to write security code directly into your application.
waveclaw is offline   Reply With Quote