Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/05/2022 in all areas

  1. Use your browser menu. In Firefox (for example) there is a "More tools" option which gives
    1 point
  2. Rifles and scopes are a typical many-to-many relationship where a rifle can have many types of scope and a scope can be used on many types of rifle. The way to handle these is with an intermediate table associating rifle ids with compatible scope ids item rifle_scope +----+---------------------+------+------+--------+ +----------------+---------------+ | id | itemname | em | gm | cat_id | | rifle_id | scope_id | +----+---------------------+------+------+--------+ +----------------+---------------+ | 1 | .308 Bolt action | 225 | 1350 | 1 | | 1 | 104 | | 2 | 7mm magnum | 300 | 1575 | 1 | | 1 | 106 | | 3 | .243 LeverAction | 215 | 8725 | 1 | | 1 | 107 | . . | 2 | 105 | . . | 3 | 106 | |104 | Scope A | 135 | 1120 | 5 | | 3 | 107 | |105 | Scope B | 235 | 1345 | 5 | +----------------+---------------+ |106 | Scope C | 215 | 2525 | 5 | |107 | Scope D | 135 | 1120 | 5 | +----+---------------------+------+------+--------+ To get a menu list of scopes for rifle #1, say, you would SELECT scp.id , scp.itemname , scp.em , scp.gm FROM item rfl JOIN rifle_scope rs ON rfl.id = rs.rifle_id JOIN item scp ON rs.scope_id = scp.id WHERE rfl.id = 1 +-----+----------+------+------+ | id | itemname | em | gm | +-----+----------+------+------+ | 104 | Scope A | 135 | 1120 | | 106 | SCope C | 215 | 2525 | | 107 | Scope D | 135 | 1120 | +-----+----------+------+------+ Probably a similar setup would apply to ammunition
    1 point
This leaderboard is set to New York/GMT-05:00
×
×
  • 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.