Results 1 to 4 of 4

Thread: PHP and Databases

  1. #1
    Join Date
    Feb 2006
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default PHP and Databases

    Hey,
    I'm brand new to PHP and mySQL, my friends and I plan to create a website this summer using that, so I've begun to learn it. My first scripting attempt was a registration page, simply fill in three input fields, hit submit, and the php will insert the info into the mySQL database. Now i figured out how to create a database, and connect to it. But my question is, on the site when i actually make it, i think it would make no sense to have the php on the main page create the same "new" database and create the same "new" tables every time someone visits. So, basically, where should i put the script to create the database and tables so that it isn't run each time someone goes to the main page? Or am i just rambling on like an idiot who forgot to read that chapter in the book?

    Thanks in advance.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You're rambling like an idiot who forgot to read that chapter.

    You seem to be talking of creating a new database every time somebody registers?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Feb 2006
    Posts
    158
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Basically, for example, the page is brand new up and running. Somebody goes and registers, and the submit button at the end of the registration forum leads you to the page register_user.php. On register_user, the php code connects to a mysql, cre - umm... y'know what, never mind. I just remembered there is an if/else function in php.

    hehe...sorry

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Heh
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •