|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Sascha Smarty n00b
Joined: 13 Nov 2004 Posts: 2
|
Posted: Sat Nov 13, 2004 6:28 pm Post subject: Übergabe eines Wertes klappt nicht |
|
|
Hallo,
ich möchte Kategorien anzeigen lassen, die anzahl der Kategorien stimmt bei der anzeige, aber die Namen werden nicht richtig angezeigt.
Im Template ist nur $categories_left_name zu sehen.
Der Code sieht wie folgt aus
Code: | <?php
$categories_left_query =db_query("SELECT
c.*,
cd.*
FROM
" . categories . " c LEFT JOIN
" . categories_description . " cd USING(categories_id)
WHERE
c.categories_status = '0'
and c.parent_id = '0'
and cd.language_id='".$language_id."'
ORDER BY
cd.categories_name");
while ($categories_left_data = db_fetch_array
($categories_left_query)) {
$categories_left_id=$categories_left['categories_id'];
$categories_left_name=$categories_left['categories_name'];
$categories_left_show .='<a href="categories.$domain/categories.php?cat=$categories_left_id">$categories_left_name</a><br>';
}
$smarty->assign('categories_left_show',$categories_left_show);
?> |
Weiß jemand von euch woran das liegt ?
Mfg
Sascha |
|
Back to top |
|
Sascha Smarty n00b
Joined: 13 Nov 2004 Posts: 2
|
Posted: Tue Nov 16, 2004 7:36 pm Post subject: |
|
|
Weiß den keiner woran das liegt ? oder wo dort der fehler drinnen ist ?
Mfg
Sascha |
|
Back to top |
|
T. Smarty Regular
Joined: 22 Aug 2004 Posts: 69 Location: AT
|
Posted: Thu Nov 25, 2004 7:59 pm Post subject: |
|
|
also liegts wahrscheinlich an der zeile:
$categories_left_show .='<a href="categories.$domain/categories.php?cat=$categories_left_id">$categories_left_name</a><br>'
probier einfach mal ein echo $categories_left_show in php, dann siehst eh obs da schon falsch ist.
ich würd mal die variablenwerte nicht direkt in den strin schreiben, sondern mit stringverkettung als "asdf" . $var . "blub" usw.
Muss man in php nicht Anführungszeichen durch \" ersetzen?
mfg Thomas _________________ Oppossom - Heavy rock from austria |
|
Back to top |
|
|
|
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
|