Location: PHPKode > scripts > AmaroK Web Frontend > obsidianmusic-2.3.0/inc/sql/mysql.php
<?php

//
//  ObsidianMusic
//   a.k.a. amaroK Web Frontend 2.0
//
//  Created 11/24/05
//   Copyright (C) Ryan Loebs (ObsidianX) 2005/2006
//   See LICENSE for GPL
//
//  mysql.php - MySQL commands
//
///////////////////////////////////////

if(eregi("mysql.php", $_SERVER['PHP_SELF'])){
	die("Cannot access directly.");
}

if(!function_exists('mysql_connect')) {
	die('php mysql module not installed');
}

mysql_connect($db['host'], $db['user'], $db['pass']) or ($enabled = false);
mysql_select_db($db['name']) or ($enabled = false);
mysql_query("SET NAMES UTF8");

function query($query){
	global $queryCount;
	++$queryCount;
	
	$res = mysql_query($query);
	if($res === false) {
		echo "Query error: $query; ".mysql_error();
	}
	return $res;
}

function fetch_assoc($res){
	return mysql_fetch_assoc($res);
}

function fetch_array($res){
	return mysql_fetch_array($res);
}

function fetch_all_assoc($res) {
	$return = array();
	while($return[] = mysql_fetch_assoc($res));
	return $return;
}
Return current item: AmaroK Web Frontend