[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
SqlInsert
Where tablename is the name of the table we want to insert the data into, the first set of brackets contain the fields you want to insert data into and the second set of brackets contain the values to go into those fields (in the same order as the fields were listed).
Note that if it is a numerical data type, you put 9 instead of '9' in the VALUE clause.
You can also do an INSERT by selecting data from elsewhere; in this case you omit the VALUES caluse and write a SELECT statement in its place; the order of the fields in the SELECT clause of the statement should match up with those in the INSERT INTO clause.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
SqlInsert
(SQL) INSERT
The INSERT statement allows you to insert data into a database. It's syntax is as follows:-
INSERT INTO tablename (field1, field2, field3)
VALUES ('value1', 'value2', 'value3')
Where tablename is the name of the table we want to insert the data into, the first set of brackets contain the fields you want to insert data into and the second set of brackets contain the values to go into those fields (in the same order as the fields were listed).
Note that if it is a numerical data type, you put 9 instead of '9' in the VALUE clause.
You can also do an INSERT by selecting data from elsewhere; in this case you omit the VALUES caluse and write a SELECT statement in its place; the order of the fields in the SELECT clause of the statement should match up with those in the INSERT INTO clause.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
