Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Daten aus aus versch. mysql Tabellen nacheinander ausgeben.

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German
View previous topic :: View next topic  
Author Message
be_fisch
Smarty n00b


Joined: 10 Mar 2005
Posts: 4

PostPosted: Thu Mar 10, 2005 12:26 pm    Post subject: Daten aus aus versch. mysql Tabellen nacheinander ausgeben. Reply with quote

Hallo,
folgendes Problem.

Ich habe 2 mySQL Tabellen:

submenus:
id,
subname,
subid.

submenus_daten:
id,
abt_id,
name,
link

So jetzt wirds komliziert. Es soll jetzt der erste Eintrag aus submenus angezeigt werden. Un dann alle Einträge aus submenus_Daten bei denen die abt_id == der subid.
Un dann so weiter.

home
link1
link2

hom2
link3
link4

Ich habe jetzt eine mysql abfrage, die mir Beide Tabellen getrennt, an Smarty übergibt.
Also ein Array für submenus und ein Array für submenus_daten.

Wie kann ich die jetzt so ausgeben wie oben beschrieben. Sicherlich geht das mit Sections oder foreach. Aber ich hab jetzt schon sämtliche Möglichkeiten durch und komme einfach nicht weiter.

Danke für euere hilfe.

Gruß Fisch
Back to top
View user's profile Send private message
ZakMc
Smarty Pro


Joined: 04 Oct 2004
Posts: 182

PostPosted: Fri Mar 11, 2005 11:17 am    Post subject: Reply with quote

Ich würde das mit 2 sections lösen.

ich schreib den code mal frei von der hand musst den dann noch richtig anpassen

Code:
 {section name=i loop=$array1}
$array1[i].name
{section name=k loop=$array2}
  {if $array1[i].id eq $array2[k].id}
    $array2[k].name
  {/if}
{/section
{/section}
Back to top
View user's profile Send private message
be_fisch
Smarty n00b


Joined: 10 Mar 2005
Posts: 4

PostPosted: Mon Mar 14, 2005 11:14 am    Post subject: Reply with quote

Danke für deine Antwort.
Hab das ganze jetzt anders gelöst, indem ich meine SQL Abfrage angepasst habe.

Jetzt bekomm ich ein Array, wo die Werte schon in der richtigen Reihenfolge drinne stehn.

Trozdem Danke.

Gruß Fisch
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Language: German All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP