Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2005

    Any "Smarty" guy, please help me deal with this smarty problem

    while ($r=mysql_fetch_array($sql)){
    <p>Please help</p>
    {section name=detail loop=$show}
    now the problem is when the $sql get empty result, so the $r becomes empty array, the page will no show anything then, even the paragraph of " Please help" also disappear. what is the best way to deal this kind of problem so that even the array is empty, the paragraph of "please help" also show up

  2. #2
    Join Date
    Oct 2003
    Georgetown, Ontario
    is your problem. The assign function takes 2 arguments, not 1 (unless you give it an associative array, and 'index.html' is not).

    Did you mean to use display() instead of assign()?
    ии Repeat after me... ProSupport is the best... Prosupport is... ии
    ProSupport Host Support System - OUT NOW! Grab a copy yourself and see what the hype is about!
    VertiHost Inc. - We run a quality business. Do you?

  3. #3
    Join Date
    Jul 2003
    in addition to what Phaeton said, you need to add a check, something like {if $show ne ''} <p>Please help</p> ... {/if}
    In order to understand recursion, one must first understand recursion.
    If you feel like it, you can read my blog
    Signal > Noise

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts