Location: PHPKode > scripts > My Db > my-db/mysql.php
<?php
/* interface with mysql server
 */
/********************************************************************/
function connect(&$server,&$user,&$password){
    return mysql_connect($server,$user,$password);
}
/********************************************************************/
function select_db(&$db, &$conn){
	mysql_select_db($db, &$conn);
}
/********************************************************************/
function query(&$query, &$conn){
     $result = mysql_query($query, $conn) or die("La consulta fall&oacute;: " . mysql_error());
     return $result;
}
/********************************************************************/
function load_data(&$result){
	if(mysql_num_rows($result)> 0){
		while ($fila = mysql_fetch_array($result, MYSQL_ASSOC)) {
			$_array[] = $fila;
		}
    }
	else{
	    $_array = false;
	}
	return $_array;
}
/********************************************************************/
function insert_id(&$conn){
    return mysql_insert_id($conn);
}
/********************************************************************/
function free_result(&$result){
    mysql_free_result($result);
}
/********************************************************************/
function close(&$conn){
    mysql_close($conn);
}
/********************************************************************/
?>
Return current item: My Db