Website Development Prices

Search Blog

Tuesday, May 12, 2015

Ucitavanje podataka iz baze iskazom SELECT (Loading data from the database with statement SELECT)

Postoji mnogo nacina upotrebe, a ovo je primarni oblik iskaza SELECT

SELECT podaci
FROM tabele
[WHERE uslovi]
[GROUP BY grupisanje]
[HAVING uslov grupe]
[ORDER BY redosled]
[LIMIT ogranicenja]
[PROCEDURE ime_proc(argumenti)]
[nacin zakljucavanja];

1. Pokrenite XAMPP. Kliknite na Admin u liniji MySQL-a ili ukucajte u address barhttp://localhost/phpmyadmin/2. Sa leve strane izberite bazu podataka volimmotore
3. Izaberite karticu SQL i unesite kod iz fajla ucitavanje-podataka.sql.


4. Klik na dugme "Go". 



Za jednu tabelu mozete zadati koliko god hocete kolona tako sto cete ih pojedinacno navesti iza rezervisane reci SELECT.

Takodje mozete navesti i druge elemente. A takav je operator * kojim se biraju sve kolone iz navedene tabele ili tabela.

Primer: ako zelite da ucitate sve kolone i redove iz tabele stvari_porudzbina.

1. Pokrenite XAMPP. Kliknite na Admin u liniji MySQL-a ili ukucajte u address barhttp://localhost/phpmyadmin/

2. Sa leve strane izaberite bazu podataka volimmotore.

3. Ubacite sledeci kod

select *
from stvari_porudzbina;

4. Klik na dugme "Go".


There are many ways to use, and this is the primary form of the statement SELECT

SELECT data
FROM table
[WHERE conditions]
[GROUP BY grouping]
[HAVING condition group]
[ORDER BY order]
[LIMIT restrictions]
[PROCEDURE name_proc (arguments)]
[Lock mode];

1. Start XAMPP. Click on the Admin in line of MySQL or type in the address bar http://localhost/phpmyadmin/
2. On the left side, select a database lovemotobikes.
3. Select the tab SQL and enter the code from the file load-data.sql.
4. Click on the "Go" button.

For one table, you can specify how many columns you want by individually specifying them behind reserved word SELECT.

You can also specify other elements. And such is the operator * which is elected by all columns from the table or tables.

Example: if you want to load all the columns and rows in the table items_orders.

1. Start XAMPP. Click on the Admin in line of MySQL or type in the address bar http://localhost/phpmyadmin/
2. From the left select the database lovemotobikes.
3. Insert the following code

SELECT *
FROM items_orders

4. Click on the "Go" button.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.