Serching amd matching>

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
phpcoder
Forum Contributor
Posts: 158
Joined: Sat Nov 02, 2002 1:18 pm
Location: Manchester, UK

Serching amd matching>

Post by phpcoder »

hI,
I got a two database table containing three fileds each. What I want to do is to search in to one table then on the basis of that serach result I want to extract some data from the other table. So if i have ckone 150ML in my one Table I want to search the price of this product from the Table 2 by just reading product description. The product decription might be in to different form like :
ckone ED 150ML Spray
Ck one Spray 150 ML ED
ck1 150ML Tester ....
etc etc

As the product description is free form text so the product supplier can add the product description the way they want. I cant change the way they descibe the product. But mostly the product description information like (may not contain all this information and they dont follow any specific sequence)
Manufacturer type size useage Male_ female
ckone ED 150ML Spray M
so [s]plz[/s] please help me how I can search it .
[s]Thankx[/s] thanks
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

As the product description is free form text so the product supplier can add the product description the way they want. I cant change the way they descibe the product.
Can you expand on this ? Why choose free form text. A nice Gui would make life a lot simpler and provide the potential for more precise results.

MySQL Full text searching may be of help but unless the data comes in a standard form, the results will not necessarily be correct. '150 ML' is not the same as '150ml' etc and you are "In My Opinion" operating to what I would call a nightmare scenario. You must always remember the phrase "Garbage in, Garbage out".


I would have things differently where you have the following tables:

Attributes
Att_id, name, description (holds Manufacturer type size useage Male_ female );

Products
Contains details not actually attributes. (prod_id included)

AttVals
Attribute values - join between Attributes and Products including a textual value for the actual 'value'.

When entering the products adding attributes and values should not be too difficult and you could code the system to provide additional help depending on the attribute type. The attributes table fields could for instance also contain what validation it needs such as numeric, freetext and also additional details such as suffix, prefix or even details of a option list displayed to the user when entering a product.

Define the requirements, get client buy in explaining why you do things this way and make your life easier in the long run.
Post Reply