FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


reading from sql db





traxion
hello,

im making a clan site, i want to use a sql database for the members. i got members in the database but how to read them out so u can see the members.

i got already

Code:

$server = "localhost";
$gebruiker = "bla";
$wachtwoord = "bla";
$db = "bla";

$connectie = mysql_connect($server,$gebruiker,$wachtwoord)
   or die ("Kon niet connecteren met de server");

mysql_select_db($db,$connectie)
   or die ("Kon de database niet selecteren");

// now im connect to the database

//but now..?
   $resultaat = "SELECT nickname FROM members";


is this good, i dont got any errors but i dont see anything

can sombody help me
n0obie4life
http://php.net/mysql_fetch_row

Smile
comp615
Use the same part you have in quotes...thats a mysql query. But to get the result you might use something like:

$data = mysql_query("SELECT * FROM `members`");

then you could go through each row like:

while($row = mysql_fetch_array($data)) {
extract($row);
echo "$variables in the db and what ever you want to do with them";
}
traxion
oke thnx man.

i get it

thnx
Related topics
Visitor notebook for php
....
Strange "mysql_num_rows()" error (Solved)
SQL Disk usage?
info
Can I install Coppermine in DirectAdmin?
gratis forum ?
Adding Images to an SQL DB
What's the best SERVLET ENGINE
how to insert data into mysql base from a web page
help with reply problem
FTP
JSP Help!!!
errors on site.. One post alot of errors to come :)
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.