Log in

View Full Version : PHP and Databases



InNeedofHelp
05-30-2006, 07:51 PM
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.

Twey
05-30-2006, 08:11 PM
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?

InNeedofHelp
05-30-2006, 08:22 PM
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. :o

hehe...sorry

Twey
05-30-2006, 08:44 PM
Heh :)