SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    parsing varaible from database

    I am doing a query which returns a variable, for example returning $user[email]

    what I want to do is then display the actual value of $user[emal] instead of $user[email]

    i think i should use the eval() function but all i can do is actually echo the value using a deviation from:

    eval("echo(\"".$result_from_sql."\");");

    instead i want the result into a variable.

    Any ideas?

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Chris you are almost there I think this should work.

    PHP Code:
    <?
    eval ("\$result_from_sql = \"$result_from_sql\";");
    print 
    $str;
    ?>
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Evangelist
    Join Date
    Feb 2000
    Location
    England
    Posts
    568
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks freddy, perfect


Bookmarks

Posting Permissions

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