× If you expect answers you should describe your problem and give as much information's as possible. (SQL-Structure, Template Code, Joomla Version ...) Please read this before posting: joodb.feenders.de/support.html

Is there any sample code for relational databases?

  • miker.reaganindustries
  • Offline
More
8 years 3 months ago #3703 by miker.reaganindustries
Is there any sample code for relational databases? was created by miker.reaganindustries
I see the page at joodb.feenders.de/forum/2-tutorials-and-...bases-and-joodb.html.

Doesn't tell me much - I need to see examples to do something like this .

I am trying to rebuild a lookup that uses the same principles.

SS attached.

Any help would be greatly appreciated!

This message has attachments images.
Please log in or register to see it.

Please Log in to join the conversation.

More
8 years 3 months ago - 8 years 3 months ago #3705 by rebers.afscmelocal52
Replied by rebers.afscmelocal52 on topic Is there any sample code for relational databases?
I use something like this above the loop in the 'Catalog-Template'.

Note: ColName, ColX, ColY represent columns in your JooDB database.
<!-- parametric ... -->
<h3>Search Items by ColX and ColY</h3>
<table><tbody>
  <tr>
    <td>ColX</td><td>ColY</td><td>Records/Page</td>
  </tr>
  <tr>
    <td>{joodb groupselect|ColX||true}</td>
  	<td>{joodb groupselect|ColY||true}</td>
       <td>{joodb limitbox}</td>
  </tr>
  <tr>
    <td  colspan="2">{joodb searchbox|ColName,ColX,ColY}</td>
    <td></td> 
   </tr>
</tbody></table>
<!-- Title wirt Sortlinks -->
<table style="width: 100%;">
    <thead>
    <tr>
        <th>Items<span style="float:right">Order by:  {joodb orderlink|ColName|Name}</span></th>
    </tr>
    </thead>
</table>
<!-- LOOP Start -->
Last edit: 8 years 3 months ago by rebers.afscmelocal52.
The following user(s) said Thank You: miker.reaganindustries

Please Log in to join the conversation.

  • miker.reaganindustries
  • Offline
More
8 years 3 months ago #3706 by miker.reaganindustries
Replied by miker.reaganindustries on topic Is there any sample code for relational databases?
Thanks so much for your help -- That got me closer but not quite where I need to be. Since I'm not a db guy, I'm having a difficult time describing what I am trying to do. Let me attempt to expound on my task at hand.

Take a look at the short video - It's out of sync for some reason but should explain what I am trying to do.

My tables are:
suspension_manufacturer
suspension_type
suspension_model

It is supposed to drilldown to produce the info:

Suspension_model:
{joodb field|suspension_model}
Manu_primary_air_spring_no:
{joodb field|manu_primary_air_spring_no}
Air_spring_fire_stone_no:
{joodb field|air_spring_fire_stone_no}
Air_spring_good_year_no:
{joodb field|air_spring_good_year_no}
Gabriel_shock_no:
{joodb field|gabriel_shock_no}
Gabriel_gasslx_shock_no:
{joodb field|gabriel_gasslx_shock_no}
Manu_lift_air_spring_no:

<td><label>Manufacturer</label> {joodb groupselect|suspension_manufacturer|1|true}</td>
<td><label>Type</label> {joodb groupselect|suspension_type|1|true}</td>
<td><label>Model</label> {joodb groupselect|suspension_model|1|true}</td>


The original DB is HERE .

Again - I really appreciate all the help - I didn't think I'd get in this far over my head!

Please Log in to join the conversation.

More
8 years 3 months ago #3707 by rebers.afscmelocal52
Replied by rebers.afscmelocal52 on topic Is there any sample code for relational databases?
So it looks like this might be appropriate for above the loop in the 'Catalog-Template'.
<!-- parametric ... -->
<h3>Search for Models by Manufacturer and Type</h3>
<table><tbody>
  <tr>
    <td>Manufacturer</td><td>Type</td><td>Records/Page</td>
  </tr>
  <tr>
    <td>{joodb groupselect|suspension_manufacturer||true}</td>
  	<td>{joodb groupselect|suspension_type||true}</td>
       <td>{joodb limitbox}</td>
  </tr>
  <tr>
    <td  colspan="2">{joodb searchbox|suspension_model,suspension_manufacturer,suspension_type}</td>
    <td></td> 
   </tr>
</tbody></table>
<!-- Title wirt Sortlinks -->
<table style="width: 100%;">
    <thead>
    <tr>
        <th>Model</th>
    </tr>
    </thead>
</table>
<!-- LOOP Start -->

Please Log in to join the conversation.

More
8 years 3 months ago - 8 years 3 months ago #3708 by rebers.afscmelocal52
Replied by rebers.afscmelocal52 on topic Is there any sample code for relational databases?
I looked at your previous database and I think I know what you're going for now, I was just pasting in a version of what I use. Also, you'll probably want to turn off all entries from being displayed (activate 'Show Only Searchform') in the menu item. Then the search results should be blank until visitors drill down to part number details. I'll adapt something below to put in 'Catalog-Template' based on your details and my (limited) expertise in this powerful but woefully documented component.
<!-- parametric ... -->
<h3>Trailer Suspension Identification Tags by Model</h3>
<table><tbody>
  <tr>
    <td>Manufacturer</td><td>Type</td><td>Model</td>
  </tr>
  <tr>
    <td>{joodb groupselect|suspension_manufacturer||true}</td>
  	<td>{joodb groupselect|suspension_type||true}</td>
       <td>{joodb groupselect|suspension_model||true}</td>
  </tr>
  <tr>
    <td  colspan="2">{joodb searchbox|suspension_model}</td>
    <td></td>  
  </tr>
</tbody></table>

<!-- LOOP Start -->
{joodb loop}

   <div class='{joodb loopclass}'><strong>{joodb field|suspension_model}</strong>
     <br />
     
     <span class='small'>
Manu_primary_air_spring_no: {joodb field|manu_primary_air_spring_no}<br />
Air_spring_fire_stone_no: {joodb field|air_spring_fire_stone_no}<br />
Air_spring_good_year_no: {joodb field|air_spring_good_year_no}<br />
Gabriel_shock_no: {joodb field|gabriel_shock_no}<br />
Gabriel_gasslx_shock_no: {joodb field|gabriel_gasslx_shock_no}    
     </span></div>

{joodb loop}
<!-- LOOP End -->
<h3>{joodb nodata}</h3>
Last edit: 8 years 3 months ago by rebers.afscmelocal52.
The following user(s) said Thank You: miker.reaganindustries

Please Log in to join the conversation.

  • miker.reaganindustries
  • Offline
More
8 years 3 months ago #3710 by miker.reaganindustries
Replied by miker.reaganindustries on topic Is there any sample code for relational databases?
Oh my goodness! Thank you again -- I will try it out first thing in the morning!!

Please Log in to join the conversation.

Moderators: Dirkjoest