If you have that php-mysql package installed, MySql is available, but you will still need to connect to the database.
I would use atleast php version4 and Mysql version 4 or higher versions because all those needed functions are not surely present at earlier versions.
Here is example code to connect and use Mysql
We tell php what database to use and give information about database user.
Then we select information from table named "users".
PHP Code:
<?php
function makeConnection() {
$dbhost="localhost:/var/lib/mysql/mysql.sock";
$dbusername="DBUSER";
$dbpassword="DBPASSWORD";
$dbname="DBNAME";
$connect = mysql_connect($dbhost, $dbusername, $dbpassword);
mysql_select_db($dbname, $connect) or die ("Could not select database");
return $connect;
}
function getSomething(){
$connect = makeConnection();
$query = "SELECT username, alias, real_name, text, mail FROM users";
$result = mysql_query($query, $connect);
while($row = mysql_fetch_assoc($result)) {
$details[] = $row;
}
return $details;
}
$userlist = getSomething();
?>
List of MySQL-functions onb PHP :
http://fi2.php.net/manual/en/ref.mysql.php