Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

Query Query

Codes here !

Moderators: macek, egami, gesf

Query Query

Postby andrewparker » Thu Dec 12, 2002 1:00 pm

I am new to SQL and am having trouble constructing an SQL Query.

Basically I have a database consisting of 3 tables, one called ILLNESS, one called PRODUCTS and one called PRODUCTLINK.

The PRODUCTLINK table contains an id linking to an illness and an id linking to a product.

I want a user to be able to enter the symptoms they have and for the database to return the illness they are suffering from and the products that will help them.

Can anyone help me with the query?

Thanks
andrewparker
New php-forum User
New php-forum User
 
Posts: 3
Joined: Wed Nov 13, 2002 8:04 am

Postby Joan Garnet » Fri Dec 20, 2002 7:38 pm

You will need to make a search engine that looks for matches with the simptoms entered by the user and then outputs the values of the two differen tables.

Code: Select all
$sql = " SELECT * FROM  PRODUCTLINK  WHERE my_row LIKE '%".$my_var."%' ";


This will look in the row my_row of the table PRODUCTLINK for matches with the string $my_var.

This is a very simple search, but you can do as you want.
;)
User avatar
Joan Garnet
Moderator
Moderator
 
Posts: 387
Joined: Sat Aug 03, 2002 2:56 am
Location: Mars


Return to mySQL & php coding

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.