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

Übergabe eines Wertes klappt nicht

 
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
Sascha
Smarty n00b


Joined: 13 Nov 2004
Posts: 2

PostPosted: Sat Nov 13, 2004 6:28 pm    Post subject: Übergabe eines Wertes klappt nicht Reply with quote

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
View user's profile Send private message
Sascha
Smarty n00b


Joined: 13 Nov 2004
Posts: 2

PostPosted: Tue Nov 16, 2004 7:36 pm    Post subject: Reply with quote

Weiß den keiner woran das liegt ? oder wo dort der fehler drinnen ist ?

Mfg
Sascha
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:59 pm    Post subject: Reply with quote

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
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