Here you can see some SQL request to put into "mysql_query".
Select something :
Code:
SELECT whatyouwant FROM yourtable
Who select in 'yourtable' all ligne
and take 'whatyouwant'
Code:
SELECT whatyouwant FROM yourtable WHERE name='value'
Who select in 'yourtable' all ligne
where name='value' and take 'whatyouwant'
Code:
SELECT whatyouwant FROM yourtable WHERE name='value'
AND name2='value2'
ORDER BY name DESC
Who select in 'yourtable' all ligne where name='value' AND name2='value2'
and take 'whatyouwant' and then order
by name descendant (DESC), you could
also right ASC for ascendant
AND could be replace by OR, <, >, <>...
Some operations :
You could also count, summarize.... I just present 2 operations but a lot of them exist :
Code:
SELECT COUNT(whatIwant) AS willout FROM mytable
SELECT SUM(whatIwant) AS willout FROM mytable
Update your database :
Code:
UPDATE yourtable SET name='value'
This will change ALL your table and 'name' will take 'value' on each line
Code:
UPDATE yourtable SET name='value' WHERE name2='value2'
This will change all your table where name2='name2',
you could use also AND, OR... as SELECT