Jump to content

Archived

This topic is now archived and is closed to further replies.

Pi_Mastuh

How do I insert their username into the database?

Recommended Posts

I need to make it so that when they hit the submit button the user's name is stored in the database. How do I do that?

Share this post


Link to post
Share on other sites
if ($_POST['submit']) {
$username=mysql_real_escape_string($_POST['username']);
$query=mysql_query("INSERT INTO table_name (ID, username) VALUES('','$username')");
}

thats a simple way but can be lots more advanced

Share this post


Link to post
Share on other sites
i say this alot on here but this helped me loads so have a look at this....

http://www.phpfreaks.com/tutorials/40/0.php

it will help you adding things to a db accessing them again and creating sessions ect ect.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.