PHP define and info from MYSQL

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • fhoger@gmail.com

    PHP define and info from MYSQL

    I’m creating a Multilanguage website using ‘define’ for al menu
    items.

    example
    define( "WELCOME", "Hello" );
    echo WELCOME ; // shows Hello


    Now i need to do this with menu items loaded from MYSQL, so for
    example


    define( "WELCOME", "Hello " );
    echo $SelectedFromMy sql[1]; // $SelectedFromMy sql [1] = WELCOME (in
    mysql db)


    $SelectedFromMy sql holds the value ‘WELCOME’, only instead of showing
    ‘Hello’ it just dhows welcome. Does anyone know hoe to fix this ?


    Thanks in advance
  • =?windows-1252?Q?=22=C1lvaro_G=2E_Vicario=22?=

    #2
    Re: PHP define and info from MYSQL

    fhoger@gmail.co m escribió:
    I’m creating a Multilanguage website using ‘define’ for al menu
    items.
    >
    example
    define( "WELCOME", "Hello" );
    echo WELCOME ; // shows Hello
    >
    >
    Now i need to do this with menu items loaded from MYSQL, so for
    example
    >
    >
    define( "WELCOME", "Hello " );
    echo $SelectedFromMy sql[1]; // $SelectedFromMy sql [1] = WELCOME (in
    mysql db)
    >
    >
    $SelectedFromMy sql holds the value ‘WELCOME’, only instead of showing
    ‘Hello’ it just dhows welcome. Does anyone know hoe to fix this ?
    If I understand correctly, you want to call a constant from a string
    that contains its name. You can use constant():





    --
    -- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
    -- Mi sitio sobre programación web: http://bits.demogracia.com
    -- Mi web de humor al baño María: http://www.demogracia.com
    --

    Comment

    • fhoger@gmail.com

      #3
      Re: PHP define and info from MYSQL

      Cool, Thanks, that did the trick :)

      Comment

      Working...