
Originally Posted by
mnpeepno2
nice, next thing you should do is tell us how to edit individual cells of a table in mysql through vb
but so far, pretty epic D:
###############################################
###############################################
A small explanation on querys:
There are 4 basic commands:
SELECT
UPDATE
INSERT
DELETE
~ Select ~
SELECT Column,Column FROM Tablename WHERE Column='Condition' AND Column='Condition'
SELECT id,HWID,GUID FROM userlog WHERE PCName='Hawk' AND IP='127.0.0.1'
Note: To select ALL columns you may just use "*"
=> SELECT * FROM userlog
~ Logical Operators ~
You can use AND,XOR,OR
AND = If both conditions are true
WHERE Column="Condition" AND Column='Condition'
OR = if atleast one condition is true
WHERE Column="Condition" OR Column='Condition'
XOR = if ONE condition is true
WHERE Column="Condition" AND Column='Condition'
If both conditions are true, it won't select anything
~ Update ~
UPDATE Tablename SET Column='Value', Column='Value'
UPDATE userlog SET HWID='asd465asd6a4sd', GUID='asd546wqda5d4'
You can sure use WHERE here, too.
UPDATE userlog SET HWID='asd465asd6a4sd', GUID='asd546wqda5d4' WHERE ID='1'
~ Insert ~
INSERT INTO Tablename(Column,Column) VALUES(Value,Value)
INSERT INTO userlog(HWID,GUID) VALUES('asdgiqwdqgwdu','asdgiawzdgqq')
~ Delete ~
DELETE Column,Column FROM Tablename WHERE Column='Condition'
DELETE id,HWID,GUID FROM userlog WHERE login='1'
Note: To delete the whole row you DO NOT use "*"
DELETE FROM Tablename WHERE... <- no "*"
~ Wildcard ~
You can use % as wildcard.
SELECT * FROM userlog WHERE Date='2/2/2010' AND Time='%' <- Time can now be everything
SELECT * FROM userlog WHERE Date='2/2/%' XOR Time='11:%'
~ ORDER BY ~
You can order the result ascending or descending.
SELECT * FROM userlog ORDER BY GUID ASC
SELECT * FROM userlog ORDER BY HWID DESC
~ Limit ~
You can limit the amount of results.
SELECT * FROM userlog ORDER BY IP ASC LIMIT 10
This will select the first 10 rows.
SELECT * FROM userlog ORDER BY GUID DESC LIMIT 5,10
This will select 10 rows after the 5th row.
~ IN ~
SELECT * FROM userlog WHERE id IN('1','5','6')
This will select all rows with the id 1,5 and 6.
~ Other operators ~
You can also use < or >.
SELECT * FROM userlog WHERE id > '10'
I do hope you understood everything
###############################################
###############################################
If you guys have any further ideas to improve this,please tell me...