Jump to content

SELECT Query


hansman

Recommended Posts

Hello all,

 

I currently have an input that you type in counties like "Countyname1, countyname2, etc". This is stored in a field in my database.

I then pull the data in the field out and use explode() to separate it from the commas. I would like a list of links for each different county, that will show information in that field.

 

If you couldnt understand that i will try differently.

 

i have a table named "AD"  In this table i have rows like "name, address, website, county, state"  I let the user decide what state they live in, then show them a list of counties that are in that state. The user will then click the county to show a list of names in that certain county. I have gotten this to work no problem when the table has one county in it. I cannot figure out how to get it to worlk with numerout counties in each row and using explode().

 

Link to comment
Share on other sites

That's because you shouldn't be storing multiple countries in one field. You should add a separate table containing a list of countries. If you're ever considering storing more than one piece of information in a field, you probably need to think about your structure and add a new table.

 

This tutorial might be a good place to start to learn more.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.