Jump to content

Automated adding of values to tables


Recommended Posts

CREATE TABLE `members` (

`id` int(4) NOT NULL auto_increment,

`username` varchar(65) NOT NULL default '',

`password` varchar(65) NOT NULL default '',





Hi, i would like to add values automattically from a form that my users fill out that corresponds to their login details. The form templete is above.



Link to comment
Share on other sites

for your members security you should allways md5 there passwords


 $query = "INSERT INTO `members` SET (`username`,`password`) VALUES ('".$username."','".md5($password)."')";


that will insert the info. when you set a field to not null you dont need to set a default value because you have to set the value.

Link to comment
Share on other sites

While you might have a database table definition (that's not a form template), your question is programming related. So, moving this thread to the php coding forum ... The mysql forum section is for problems using mysql, such as a query that produces an error.


Getting the data from a form and inserting it into a database table is a very common task and there are countless php code examples posted all over the Internet showing how to do this.


Sorry to repeat, but you should be asking for help with specific problems or errors with your code or query. If you don't have any code and are just listing what you want to do "i would like to add values automatically ..." then you need to first attempt to create or find code that does what you want and try to accomplish your stated goal.



Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

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.