another php/mysql question.. this time it's about separator's

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • poe
    Confirmed User
    • Mar 2004
    • 455

    #1

    another php/mysql question.. this time it's about separator's

    also: i have a separator between each entry.. is there an if something() to check if it's the last entry, so the separator doesn't show up at the end?

    now i have:

    Code:
    echo $row['name'].", ";
  • mrkris
    Confirmed User
    • May 2005
    • 2737

    #2
    You need to post to a php forum, not gfy

    PHP-MySQL-Rails | ICQ: 342500546

    Comment

    • poe
      Confirmed User
      • Mar 2004
      • 455

      #3
      Originally posted by mrkris
      You need to post to a php forum, not gfy
      it's all good

      Comment

      • mrkris
        Confirmed User
        • May 2005
        • 2737

        #4
        hit me up on icq, i'll help ya out.

        PHP-MySQL-Rails | ICQ: 342500546

        Comment

        • Azlord
          Confirmed User
          • Dec 2003
          • 2651

          #5
          Well, do you have an ID column in your table? if so, you can always do something like
          if ($row['id'] = mysql_num_rows($res)) {
          echo "whatever without the comma";
          } else {
          echo "what you want";
          }

          I think that would work. There might be a small catch. Can't really tell unless I had something to test with.

          Comment

          • mrkris
            Confirmed User
            • May 2005
            • 2737

            #6
            implode()

            PHP-MySQL-Rails | ICQ: 342500546

            Comment

            Working...