Note that there are some explanatory texts on larger screens.

plurals
  1. PODatabase table structure query
    primarykey
    data
    text
    <p>Just a quick query on the best databased structure to go with for a small application, [ the database will be SqlLite or MySql and the app written in PHP if that helps]</p> <p>Basically my issue is that entries will have many options and these will be likely to be added to and removed so editing the db structure is probably not the best idea. I am just wondering what the best way to store this options to the data base. In similar situations in the past I have achieved this by storing the data serialised or in JSON format to a table row, but I am wondering if this is the best option, any advice would be great. </p> <p>The application is map based where a user can add/remove markers, the markers have types [ eg shop, school, hospital etc. ] the user can also add and remove types. In addition to this the use can create map views eg a map where only the school and hospitals are visible.</p> <p>It is a bit hard to describe but here is a go describing the [ simplified ] table structure</p> <p><em><strong>markers</em></strong> </p> <pre><code>+---------+-----+-----+--------+-----------+ |markerID | lat | lng | typeID | name | +---------+-----+-----+--------+-----------+ |1 | 52 | -9 | 1 | A School | |2 | 52 | -9 | 2 | A Shop | |3 | 52 | -9 | 1 | B School | |4 | 52 | -9 | 3 | A Hospital| +---------+-----+-----+--------+-----------+ </code></pre> <p><em><strong>marker types</em></strong></p> <pre><code>+-------+-------------+--------------+ |typeID | name | icon | +-------+-------------+--------------+ |1 | Schools | school.png | |2 | Shops | shop.png | |3 | Hospitals | hospitals.png| +-------+-------------+--------------+ </code></pre> <p><em><strong>map view</em></strong></p> <pre><code>+------+---------------------+---+ |mapID | name | ??| +------+---------------------+---+ |1 | Schoool &amp; Shops | ??| |2 | Hospitals &amp; Schools | ??| +------+---------------------+---+ </code></pre> <p>So my question is basically, what is the best way to store the information that mapID #42 should display markers with typeID #2, #5, and #23 for example.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload