Help with Query Required!!!!!!!!!!!

admin

Administrator
Staff member
Here's the layout with my database and the relevant fields:

Table: clients
- CID (Client ID - auto increment, Primary Key)

Table: interests
- IID (Interests ID - auto incremenet, Primary Key)
- CID (Client ID - foreign key from clients table)
- I1 to I7 (Interest#1 to Interest#7)

Basically, i'm trying to connect the interests a new user selects to their Client ID. For example: if client#221 selects Baseball, Basketball, Football, Hockey and hiking as their interests. I want to these interests to associate with just that one person.

I've started a query but it doesn't work because I doubt it's a legal statement:

$query2 = "INSERT INTO interests (I1,I2,I3,I4,I5,I6,I7)
VALUES
('$Interest1','$Interest2','$Interest3','$Interest4','$Interest5','$Interest6','$Interest7')
WHERE
('$interests.CID' = '$clients.CID')"

Can someone help me out?
 
Back
Top