Help using "CONCAT" ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Rob (SA)
    Lieutenant Colonel

    • Nov 2006
    • 586

    Help using "CONCAT" ?

    Hi folks,

    I have a table with data surname and name and currently some info populates a field in page www.gnjgf.co.za/rankings.php

    I would like to know how to make a change that the field shows the surname, name of the player and not just the surnames as is currently veiwed.

    Your help would be appreciated
    Kind Regards
    Rob
    www.gnjgf.co.za
    www.oryan-projects.com
  • Watdaflip
    Major General

    • Sep 2005
    • 2116

    #2
    Re: Help using "CONCAT" ?

    Assuming both "surname" and "name" as different columns you can just echo both right next to eachother on your webpage that displays it.

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

    Comment

    • navaldesign
      General & Forum Moderator

      • Oct 2005
      • 12080

      #3
      Re: Help using "CONCAT" ?

      Change the code in the drop down Inside Tag to :


      ><?php
      $query = mysql_query($query1);
      while($row = mysql_fetch_assoc($query))
      {
      echo '<option value="'.$row['surname'].' '.$row['name'].'">'.$row['surname'].' '.$row['name'].'</option>';
      }
      ?

      You will also need to change the "before Tag" code in:

      <?php
      $connect = mysql_connect("localhost", "?????_?????", "?????") or
      die ("Hey loser, check your server connection.");
      mysql_select_db("?????_Members");
      $query1="select * from _Form_Nr_2 ORDER BY `surname` ASC, `name` ASC";
      ?>





      Navaldesign
      Logger Lite: Low Cost, Customizable, multifeatured Login script
      Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
      DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
      Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!

      Comment

      • Rob (SA)
        Lieutenant Colonel

        • Nov 2006
        • 586

        #4
        Re: Help using &quot;CONCAT&quot; ?

        Hi George,

        Thanks it works like a dream.
        Kind Regards
        Rob
        www.gnjgf.co.za
        www.oryan-projects.com

        Comment

        Working...
        X