Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 949773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:27:23+00:00 2026-05-15T23:27:23+00:00

In my database table I have the following fields: Table Supplier: id name vehicles

  • 0

In my database table I have the following fields:

Table Supplier:

  • id
  • name
  • vehicles

A supplier can have multiple vehicles. The field ‘vehicles’ will store multiple values. At the moment I am delimiting the values on a ‘pipe’ symbol, although this can be changed to a comma if need be.

On my front-end form I have a checkbox list – a user can select multiple vehicles. The back end script needs to do a search and bring back all suppliers that contain any of the specified vehicle id’s.

So in other words we are searching with multiple values in a multiple value field.

The checkbox list name is vehicle_type[] and will end up in the $_POST array as (for example):

Array 
( 
    [0] => 1 
    [1] => 4 
    [2] => 6 
)

Is this possible to do? I could obviously do this using a join table but ideally I would like to do it this way. I am using PHP as my scripting language if that helps.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T23:27:24+00:00Added an answer on May 15, 2026 at 11:27 pm

    The field ‘vehicles’ will store multiple values. At the moment I am delimiting the values on a ‘pipe’ symbol, although this can be changed to a comma if need be.

    Please don’t do that. Storing delimited data in a text field is no better than storing it in a flat file. The data becomes unqueryable.

    You want a nice, happy, normalized database.

    CREATE TABLE Suppliers (
        supplier_id INTEGER PRIMARY KEY,
        ...
    );
    
    CREATE TABLE Vehicles (
        vehicle_id INTEGER PRIMARY KEY,
        ...
    );
    
    CREATE TABLE Supplier_Vehicles (
        supplier_id INTEGER NOT NULL REFERENCES Suppliers(supplier_id),
        vehicle_id INTEGER NOT NULL REFERENCES Vehicles(vehicle_id),
        UNIQUE KEY(supplier_id, vehicle_id)
    );
    
    -- Grab all the Vehicles for Supplier 39
    SELECT Vehicles.*
      FROM Vehicles, Supplier_Vehicles
     WHERE Supplier_Vehicles.supplier_id = 39
       AND Supplier_Vehicles.vehicle_id = Vehicles.vehicle_id
    

    The checkbox list name is vehicle_type[] and will end up in the $_POST array as (for example) […] Is this possible to do?

    It’s very possible, and is a good idea. Try it and find out how well it works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following database structure: CREATE TABLE LookupTable ( PK UNIQUEIDENTIFIER PRIMARY KEY,
I have a database table, let's call it headers with an id and a
I am writing a rails 3 application, and I have a database table of
I have the following Entity model: public class Todo { [Required] public int ID
I have a dataset that consists of prices for various rental cars. The data
I am using a SQLite to store data in Android application . I need
I'm a relative newbie when it comes to database design. I know how to
I'm working on a web project. I'm using a Sql Server 20008 R2 database
I have a pedantic argument that needs resolution. As a proper koolaid drinker when
I am building an application using the latest copy of Codeigniter 2.0. My application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.