• I need help with a simple mysql system?
    4 replies, posted
I want to be able to make a system where the user inputs a search and the php will match another word with that search, for example: if a person searches "on" it will return "off" and it would do it backwards too, if they search "off" it would return "on". There will be alot of different words so if-statements are out of the question. Could I get some guidance on how to make this. I'm good with PHP but not with mysql :(
Not seeing how it needs to have MySQL, and how you even brought MySQL into this.
[QUOTE=compwhiziitothemax;19806581]Not seeing how it needs to have MySQL, and how you even brought MySQL into this.[/QUOTE] It will need a database to store all of the words.
You mean antonyms? You'd need to find a list of them and write a script to put them into the MySQL database first.
Make two fields. In one field, the word 'on' would be there, and in the other one 'off' would be there. Now all you need to do a query, search for the word (let's say 'off') and just select the field that isn't the word you searched. Not sure of the particular needs of your system, but for the example you presented this would work.
Sorry, you need to Log In to post a reply to this thread.