zero-perfoliate
zero-perfoliate

Author Topic: Search database, formatting the output results  (Read 552 times)

Offline axelwing

  • New PHP Members
  • Posts: 2
  • Karma: +0/-0
Search database, formatting the output results
« on: December 12, 2008, 10:27:28 PM »
Hello,

I have a website with a MySQL database behind it and I made a search form, a results.php page and a details.php page.
One of the fields in a table from the database is "products" where it is suppose to be a big amount of information (text).
When a user is searching for a company for example, a table with 10 records per page is displayed on the results.php and from there, the user can go to each company's details by clicking on its name.

Now, being so many products for each company, I would like to know how can I display on the results.php, for each company, only the product the user is being searched for, IF that product is already in the database, of course.

Also, is there a way to have a "read more..." link on the same products field?

Do I need to post some code here? Please let me know.

I am not proficient in PHP and MySQL, just started to learn so a little detailed help would be greatly appreciated.


Thank you very much for your help.

Axel

Offline PhPHelper

  • http://Digiscapers.com
  • Full Member
  • PHP Problem Solvers
  • ****
  • Posts: 179
  • Karma: +50/-0
    • Bad Apple Mail
Re: Search database, formatting the output results
« Reply #1 on: December 16, 2008, 05:41:35 PM »
yes you could do another query in the results page to only bring out products that match the search term.

I wrote a tutorial on searching a database using match statements which are more effective then using like the tutorial is located at http://www.webguideuk.com/php/searching-with-php-and-mysql-beyond-like

Offline axelwing

  • New PHP Members
  • Posts: 2
  • Karma: +0/-0
Re: Search database, formatting the output results
« Reply #2 on: December 17, 2008, 04:21:55 AM »
Thanks a lot  :), I will take a close look on it and will try to adapt it to my pages.

Axel.