PHP Searching!

pavstapavsta BeginnerLink Clerk
Hi,

Im trying to make a php search script that searches a pretty big database for information, but im wondering what is the best way to do this? Ive tried the BOOLEAN and the Like Phrase method but they both dont show accurate enough results! What else could you suggest?

- Thanks.

Comments

  • PythonPython Forum Leader The Royal RAM
    I would also like to find out more about PHP searching

    The Royal Ram

  • dabossdaboss WP V.I.P. ''The Boss'' Administrator
    What do you mean by "BOOLEAN and the Like Phrase"?

    When you perform a search, you need to have criteria to search... for accurate results when you know the exact criteria, you need to use something like "... where field = 'something'". if you don't know the exact criteria, you use "... where field like 'something'".
  • pavstapavsta Beginner Link Clerk
    daboss wrote:
    What do you mean by "BOOLEAN and the Like Phrase"?

    When you perform a search, you need to have criteria to search... for accurate results when you know the exact criteria, you need to use something like "... where field = 'something'". if you don't know the exact criteria, you use "... where field like 'something'".

    yes, thats good/works but when you have a large database full of records its very inaccurate.
  • ForgeForge Senior Member The Royal RAM
    Have it so its like LIKE '%$query%', I think thats how I did mine...
    Can fat people Go skinny Dipping?
  • dabossdaboss WP V.I.P. ''The Boss'' Administrator
    pavsta wrote:
    yes, thats good/works but when you have a large database full of records its very inaccurate.

    hmm... obviously it would be inaccurate if your search criteria is not specific enuf. actually, i'm not sure what you're trying to accomplish... maybe if you could give a description of that, we can suggest a more defined solution...
  • pavstapavsta Beginner Link Clerk
    yes Forge thats how i did/do it, using the % wildcard, but its still inaccurate, ok an example is if your searching for an item in a huge list of items, sometimes the results come up with something totally random. i.e. you search banana and it comes up with orange
  • dabossdaboss WP V.I.P. ''The Boss'' Administrator
    pavsta wrote:
    ...sometimes the results come up with something totally random. i.e. you search banana and it comes up with orange

    sorry to say that what you have mentioned is not possible. the database will not be wrong. it would be your query that is not correct.

    post a sample query and tell us what you expect it to do...
  • ForgeForge Senior Member The Royal RAM
    True... boss has a point there. Maybe you should have a drop down. Have like Search in: PHP, CSS, ASP and when the mySQL query is executed, have it search that specific term.
    Can fat people Go skinny Dipping?
Sign In or Register to comment.