All pastes #506819 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-05-24 06:22 UTC
rendered paste body
<?php
require 'TmysqlDB.phpc';
require 'TExceptionHandler.phpc';
try
{
	$mwdb = TmysqlDB::get_Instance();
	$mwdb->set_ConnectionParams('127.0.0.1','port','user','pswd');
	$mwdb->connect();
	$sql = $mwdb->query('SELECT 1+1 AS Sum');
	$mwdb->disconnect();
	$arr = mysql_fetch_assoc($sql);
	mysql_free_result($sql);
	$url = '/lyrics/'.$arr['Sum'];
	header("HTTP/1.1 301 Moved Permanently");
	header("Location:".$url);
	header("Connection: close");
}
catch (Exception $E)
{
	TExceptionHandler::print_Exception($E);
}
?>
This works :)