Sign in
Log inSign up

How to handle choose all options in a select box on back-end?

Aqueel Aboobacker's photo
Aqueel Aboobacker
·Sep 29, 2017

I'm asked to give users an option to choose all areas and routes in a select box

How to design database for this purpose ?

How I can handle foreign-key based relations if I store this as a record ?

idnamearea_idcountry_id
0allnullnull
1Route 11210
<select name="routes" >
    <option value="0">All</option>
    <option value="1">Route 1</option>
    <option value="2">Route 2</option>
     ..
     ..
</select>

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct