Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
Rad sa Bazom

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
Kian



Joined: 17 Oct 2004
Posts: 2

PostPosted: 17.10.2004 17:19    Post subject: Rad sa Bazom Add user to your forum ignore list Reply with quote

Helou, posto se inace ne bavim ovime molim malo objasnjenje Wink

Za vas advancere ovo ce biti ful easy, u biti kako izvlaciti nesto iz baze ? Npr. bazu kreiram preko My Sql-a. I kreiram nekoliko unosa u tu bazu, npr. 5. Polja u bazi su ime, prezime, novost, datum.

Ja bih onda sadrzaj iz te baze izvlacio u npr. news.php...

Moze netko objasniti u kratkim crtama ?

Puno hvala!

_________________
Musicland Smile
Back to top
View user's profile Send private message
che.UP
mi3.crew


Joined: 07 Sep 2003
Posts: 2320
Location: zagreb

PostPosted: 17.10.2004 22:42    Post subject: Add user to your forum ignore list Reply with quote

pogledaj u tutorijalima - shoutbox - tamo imas jednostavan princip pisanja i citanja iz baze... ako nesto nije jasno, pitaj :)

btw, dobrodosao :)

_________________
UP | TypeTester | Accommodations App
Meni u Firefox-u ne radi AJAX
Back to top
View user's profile Send private message Visit poster's website
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 18.10.2004 11:30    Post subject: Add user to your forum ignore list Reply with quote

Iz php-a se spojiš ovako:
http://www.php.net/manual/en/function.mysql-connect.php
Onda selektiraš bazu gdje su ti tablice:
http://www.php.net/manual/en/function.mysql-select-db.php

Onda preko te konekcije napraviš query kao string
Code:
$q = "SELECT name,surname FROM people";
$results = mysql_query($q,$link);


Sad imaš nečitljivu varijablu $results gdje su ti rezultati query-a, iz nje izvlačiš podatke petljom i funkcijama oblika mysql_fetch, recimo mysql_fetch_array():
http://www.php.net/manual/en/function.mysql-fetch-array.php

Petlja je potrebna jer se u array izvlači samo prvi redak sql rezultata, sljedećim pozivanjem drugi itd.

Nakraju zatvoriš connection sa mysql_close().

PHP.NET is your FRIEND
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Kian



Joined: 17 Oct 2004
Posts: 2

PostPosted: 18.10.2004 15:22    Post subject: Add user to your forum ignore list Reply with quote

Kul ! Thanks ljudi, mislim da ce mi ovaj primjer za shoutbox pomochi totalno ! Very Happy

_________________
Musicland Smile
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group