Page 1 of 1
could anyone post a php code for database
Posted: Mon Dec 01, 2003 7:14 pm
by peacer
hi, could anyone post an simple example on how to connect to database and retrieve data from the database......if can, could u pls, pls, pls, pls help me..... i need it very urgently..........
Posted: Mon Dec 01, 2003 9:50 pm
by m3mn0n
Check out this link:
http://www.php.net/mysql
The manual has a listing of all the PHP functions and what they do. I'd keep it bookmarked and browse around it often to better enhance your learning.
Cheers.
i cant get wad i want
Posted: Tue Dec 02, 2003 6:55 pm
by peacer
the address u gave me is not wad i know, i know is the sample of a dataase connection........
Posted: Tue Dec 02, 2003 8:00 pm
by infolock
you are still going to need to read the manual link that sami posted if you are ever going to learn anything about interaction with mysql...
but here you go anyways :
Code: Select all
mysql_connect ('localhost', 'username', 'password');
mysql_select_db('bob');
$foo = "Select me from table";
$bar = mysql_query($foo);
$row=mysql_fetch_assoc($bar);
echo $row['me'];