I am attempting to write a PHP script to search for a product on a MySQL server. I am not sure of how to search for a value or something similar in the product name column. Does anyone have any ideas?
First: Write a PHP script that connects to your database. Then if everything worked out well you just have to execute (with PHP) the following SQL query:
SELECT * FROM your_table WHERE your_name LIKE 'name'
or if you want to just get the names that begin with a "A"
SELECT * FROM your_table WHERE your_name LIKE 'A%'
You should take a look at the LIKE operator and read the pattern matching page on Mysql site: http://dev.mysql.com/doc/refman/5.0/en/pattern-matching.html
If you want to look for something that has a word in it then you can use this:
SELECT * FROM web WHERE Description LIKE '%$each%' OR Title LIKE '%$each%'
That code when looking for "facebook"
would return any result that contains "facebook" anywhere within the database Description or Title sections that contain the word "facebook" at all