Web Analytics Made Easy -
StatCounter Variable Troubles - CodingForum

Announcement

Collapse
No announcement yet.

Variable Troubles

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Variable Troubles

    Hello,
    Ok so im after two answers at the moment,
    when i see a url like this: http://www.example.com/index.php?other=new
    does that mean the php coding on the page has a variable and that varable is set to other when you load that link, and my other question is im trying to make a table in mysql with a variable like such:

    PHP Code:
    $named=$_POST['username'] . "'s mail";
    mysql_query(CREATE TABLE '$named'(id varchar(15), subject varchar(15))"; 
    why doesnt that work.
    thanks.
    The internet is my Sandbox, and notepad is my Spade n' Bucket.

  • #2
    variables attached to the url, as in your example, end up in the $_GET array
    ($_GET['other'] will be 'new' with your example).

    The reason your code isn't working is probably because of the space (and maybe the ') in your table name.

    Creating a separate table for each user (as it seems you're trying to do) isn't necessarily the best approach though.
    Instead, you could add an extra column to your table ('username' perhaps) and store the details in a single 'mail' table.
    My thoughts on some things: http://codemeetsmusic.com
    And my scrapbook of cool things: http://gjones.tumblr.com

    Comment


    • #3
      hmmm, perhaps but a won't it take along time, say 1000 users at 30 messages total each, 30,000 messages is a lot to search through.

      however your answer accoured to us when we we're in the process of planning and i suppose it would save web space.

      Yeah, it is gonna be making a new page for every user anyway so i may aswel just use one table, everything else takes along time to search through.
      The internet is my Sandbox, and notepad is my Spade n' Bucket.

      Comment


      • #4
        30,000 records is miniscule for mysql to handle. your tables are large once you reach the 10s or 100s of millions of records.

        Comment


        • #5
          oh, i've never released, wow thanks for pointing that out. wow...
          The internet is my Sandbox, and notepad is my Spade n' Bucket.

          Comment

          Working...
          X