[Tutorial] MySQL-queries
#1

Hey,
A week ago I learned opinion, MySQL, I am skilled in.
And now this manual mainly focus on basic ה"שאילתות".

# SELECT.
# WHERE.
# INSERT.
# OR.
# AND.

SELECT STATEMENT

The query that you actually pick the table you choose open entries.
PHP Code:
SELECT ' value ' FROM ' key ' 
In fact chose the value value in the key table, give an example,
PHP Code:
SELECT ' name ' FROM ' accounts ' 
In fact we have chosen the name value of the accounts table.
To give another example,
PHP Code:
SELECT FROM ' accounts ' 
In fact it takes all values, if you want to get some good values.
PHP Code:
SELECT ' name '' password '' kills ' FROM ' accounts ' 
In fact it takes the name values, paassword, kills, from accounts.
Now another example,
PHP Code:
SELECT ' ID ' FROM ' accounts ' WHERE ' username ' ' iRaiDeN 
It selects the value ID, from accounts, where the name is iRaiDeN.
The query WHERE CLAUSE study.

WHERE CLAUSE

Now this query actually turns to where you like where is X.
To give an example,
PHP Code:
SELECT ' password ' FROM ' accounts ' WHERE ' username ' ' iRaiDeN 
As above, select the password entry, where is and where the accounts table is the username iRaiDeN.

INSERT
Action actually gets values to the table we want
PHP Code:
INSERT INTO ' accounts ' (' username '' password '' kills '' death 'VALUES (' iRaiDeN '' 123 '00
In fact we have added entries for the accounts table values username, password, kills, death, and each has its own value.

OR

This function basically saying "or" I will give an example to illustrate.
PHP Code:
SELECT ' password ' FROM ' accounts ' WHERE ' username ' ' iRaiDeN ' OR ' username ' ' OzSasson 
Basically this selects the entry password, from accounts, where iRaiDeN is the name or if the name is OzSasson.

AND

A query that says "also", in addition, give an example and explained,
PHP Code:
SELECT ' password ' FROM ' accounts ' WHERE ' username ' ' iRaiDeN ' AND ' ID ' ' 2 ' 
We chose the entry password from accounts where the username value, which is equal to iRaiDeN, and also the value ID equals 0.

The end of the Guide, I just have a few comments,
* Do.
'' Values.
*
In '' the name of the database/table/field.
* Committed to write the queries only in writing.
All those OS.
Reply
#2

I hardly understood anything at all. Please try to to improve your English. Wrapping field names in quotes is invalid and will throw an error. Wrapping any non-string value in quotes is also unnecessary.
Reply
#3

Quote:
Originally Posted by Vince
View Post
I hardly understood anything at all. Please try to to improve your English. Wrapping field names in quotes is invalid and will throw an error. Wrapping any non-string value in quotes is also unnecessary.
i know it's translated form hebrew, i'm i sory, i don't have any power to improve all to english.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)