how to retrieve data in php from mysql databases

Well, this needs a tutorial .. or a BOOK :D
The short (veeeery short) version is:

require_once('database.php'); //you db username,pass,address...
mysql_select_db($database, $connection);
$query = sprintf("SELECT * FROM table WHERE id = 1"); //We need just the first record
$recordset = mysql_query($query, $connection) or die(mysql_error());
$row = mysql_fetch_assoc($recordset);
echo 'The ID is' . $row['id'] . 'and the name is ' . $row['name'];

This is using mysql. If you're new, i'll suggest using mySQLi.
you could check out this for more info > http://www.w3schools.com/PHP/php_mysql_intro.asp
Good luck in your journey :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.