View Full Version : How can I develop a "search product by characteristics in PHP"
07-10-2006, 07:27 AM
Hello, something can help me?
I need to develop a product searcher, with option to choose ex.
Color: - Red - ble - white
Dimension: - large - small - medium
material: - cotton - nylon
Then: product 1 or 2 or 3
In PHP with sql
07-16-2006, 10:49 PM
Hmm. From what I understand in your posting.
You first of need to have your tables to have the fields for options. If you are coding from
You need to make sure you strip out and potential SQL injection attacks in these variables and verify that is what you are expecting. Try using mysql_escape_real_string()
$searchColor = POST/GET var
$searchDimension = POST/GET var
$searchMaterial = POST/GET var
$sql = "SELECT * FROM ProductsTable WHERE color = `$searchColor`, dimension = `$searchDimension`, material = `$searchMaterial`... etc ORDER BY $searchColor";
If you are trying to do this as a shopping cart. Try looking into ones that are already made. One such is CubeCart with product options and search.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.