in all of these examples, "..." just means you can have as many fields as you want.
basic insert:
Code:
INSERT INTO table (field1, field2, ...) VALUES ("field1data","field2data",...);
another way to insert:
Code:
INSERT INTO table SET field1="field1data", field2="field2data", ...;
basic retrieval of results:
Code:
SELECT * FROM table;
only retrieve certain fields:
Code:
SELECT field1,field2,... FROM table;
selective retrieval of results:
Code:
SELECT * FROM table WHERE field3="field3value";
ordering the results retrieved:
Code:
SELECT * FROM table ORDER BY field3;
only retrieve the first few results (up to the number specified):
Code:
SELECT * FROM table LIMIT number;
deleting all rows:
deleting certain rows:
Code:
DELETE FROM table WHERE field1="field1data";
you can combine just about any of the modifiers above, for example,
Code:
SELECT userid,username FROM users WHERE usergroup="test" ORDER BY userid LIMIT 30;
would give me the username and userid of the first 30 people in the users table whose usergroup is "test", ordered by their userids.