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

DB Abfrage mit HTML Darstellung

 
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
Bjoern3003
Smarty Rookie


Joined: 22 Nov 2004
Posts: 7

PostPosted: Wed Nov 24, 2004 11:14 pm    Post subject: DB Abfrage mit HTML Darstellung Reply with quote

Hi,

ich möchte per Datenbank abfragen, ob der wert xy in der Tabelle besteht. Sollte er drinnen sein, darf der HTML Code nicht angezeigt werden.


Beispiel:
Tabellenname "obst"
Inhalt: banane, Apfel, Birne

Wenn jetzt in der Variablen "$xy", die Birne drinnen steht, darf der HTML Code nicht angezeigt werden. Steht aber Pfirsich drinnen, soll der HTML Code angezeigt werden.

Ist sowas auf Basis von Smarty möglich??
Back to top
View user's profile Send private message
the-styler
Smarty Rookie


Joined: 12 Jul 2004
Posts: 25

PostPosted: Thu Nov 25, 2004 4:50 pm    Post subject: Reply with quote

Dies ist möglich. Du machst ganz normal deine abfrage in PHP. Dann übergibst du den wert smarty mit assign und prüfst das ganze in smarty mit einer if abfrage. den auszugegeben code schtreibst du dann in die if abfrage und sorgst dafür das sie true ist damit der html code ausgegeben wird.
Back to top
View user's profile Send private message
T.
Smarty Regular


Joined: 22 Aug 2004
Posts: 69
Location: AT

PostPosted: Thu Nov 25, 2004 7:49 pm    Post subject: Reply with quote

einfach smarty code:

{if $xy ne "Birne"}
schreibe HTML Code
{/if}

siehe Smarty Dokumentation für Details
_________________
Oppossom - Heavy rock from austria
Back to top
View user's profile Send private message Visit poster's website
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