- Forums
- MySQL
- MySQL INSERT Query How To Add Data To Database Table
This Page Contains information about MySQL INSERT Query How To Add Data To Database Table By wallpaperama in category MySQL with 0 Replies. [890], Last Updated: Sat May 18, 2024
wallpaperama
Tue Feb 19, 2008
0 Comments
3403 Visits
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'"