PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Nov 20, 2019 5:53 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Jun 17, 2019 5:25 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4434
Location: United Kingdom
Hi there

I'm a little bit rusty these days with My-SQL so hoping I can be led into a good route for this.

We have been asked to do a website where people can answer questions (from dropdown answers), and the result will bring up a list of providers for language support.

So if you answer Yes to "can you write a letter in English", then it will find all those providers who have stated whether they can support that.

So far these are my tables

Add question to db-Questions
id
question

Add answers to db-Answers
id
Qid
answer
ProvideId (array)

Add providers to db-Providers
id
contact name
company
address1
address2
town
county
postcode

My difficulty is how to assign providers to the answers. ie. if an answers means providers 1, 3 and 7 need to be selected, how do I do that?

Would it go into a ProviderIDs field, as 1,3,7 using an array, and then 'explode' it in a query?

How would I go about doing that? 4 years ago I could have figured it out but am a little rusty!

Thanks.


Top
 Profile  
 
PostPosted: Sat Jul 06, 2019 2:28 pm 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13592
Location: New York, NY, US
You could put "1,3,7" in the ProvideId field, or create a forth Answers_Providers table that has AnswerId and ProviderId fields.

_________________
(#10850)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group