MySQL INSERT query how to add data to database table

RegisterLogin
MySQL INSERT query how to add data to database table
Post Description: MySQL INSERT query how to add data to database table
Tags: MySQL, INSERT, query, how, to, add, data, to, database, table
This Post Was Posted On Feb 29, 2008 By web hosting #1493
to add information into a mysql database table, its called INSERT

this is an example:

lets say i have a web form and i want to add a user to the user table i would send this sql query,
the user submits this information:
username = eric
password = mypass

so this is how i would insert this information into my database

PHP CODE:
$sql = "INSERT INTO table (username, password) VALUES ('eric','mypass')"


another way to send this mysql query would be like this:

PHP CODE:
$sql = "INSERT INTO table SET username = 'eric', password ='mypass'"



Leave Your Comments
Related Pages: [Add Your Website]
Post New Topic
©2012 Webune Forums - Wed Dec 19, 2012 11:11 am
Powered by: Webune Forums V3