Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Dec 2003
    Location
    texas
    Posts
    96
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Making table name equal variable

    Hello I was wondering if you might be able to help. I was wondering how I would make a table name equal a variable.

    I have this
    Code:
    if ($display == "Premiums")
    {
    $premiums2='Premiums2'
    $query2 "Select * from $premiums2";
    }
    but it does not seem to work, and I get the following error

    Parse error: parse error, unexpected T_VARIABLE
    thanks
    bri

  • #2
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    missing ; on the first line inside the if-block.
    [edit] and a missing = on the other line.
    My thoughts on some things: http://codemeetsmusic.com
    And my scrapbook of cool things: http://gjones.tumblr.com


  •  

    Posting Permissions

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