SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2006
    Posts
    412
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Insert dynamic table name

    Hi, im trying to insert into a db table 'blog_it '

    Ive declared values using:

    PHP Code:
    $lang $_GET['lang'];
    $mdb "blog_";
    $mdbf $mdb $lang
    ..and insert using:
    PHP Code:
        $query "
    INSERT INTO "
    .$mdbf." (..... 
    ..however i get an error that 'blog_' can't be found (without the 'it')....ive echo $mdbf on the page and the full value is shown

    ...what i doing obviously wrong?...thanks in advance

  2. #2
    SitePoint Zealot bronze trophy xMog's Avatar
    Join Date
    Mar 2011
    Posts
    148
    Mentioned
    3 Post(s)
    Tagged
    1 Thread(s)
    Are you calling your URL like this: http://www.yoursite.com/page.php?lang=it
    ?


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
  •