Jump to content

php or mysql for interpreting text field input?


paulmo

Recommended Posts

i'm wondering which is better, php or mysql database, to search for certain key words from user submitted text form, and return text answers based on the key words? like if "tree" were one of the words, a passage uploaded to database table (or in php page?) about trees would be echoed. and if "my tree" were submitted, "your tree..."etc. would be echoed. in other words, need php or mysql to "read" the user submitted text.

 

how to begin to do this? thanks.

Hummm... Well if my PHP you mean returning all records from a database then looping until you find it or reading from a text file then i would say MySQL.. PHP works well with MySQL its designed for holding data and allowing searched also on the server its better to divide the tasks to again MySQL.. thats if i understand your question

yes thank you that's along the lines...except matching user submitted text form key words with those words in db files (not just searching db files alone). also could multiple words be searched in same user submitted text and associated database files be echoed according to order of importance of words?

 

 

$query=mysql_query("SELECT * FROM table WHERE field LIKE '%sometext%'");

 

%sometext% = search with "sometext" anywhere inside "field"

sometext% = search with "sometext" at the end of "field"

%sometext = search with "sometext" at the start of "field"

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.