joelwan/php-object-generator — pull request #2 by Loksly (2011-12-05 13:04:05+00:00)
Title: pog_base mysql_real_escape usage

Corrected pog_base mysql_real_escape usage. It didn't use the right database connection, instead it used the default, so charset doesn't have to be the right one.

Joel, I also suggest to add a:

$configuration['encoding'] = 'utf8';

so that when Database is created it might use a method like:

-------------
private function Database()
{
$numQueries = 0;
$databaseName = $GLOBALS['configuration']['db'];
$serverName = $GLOBALS['configuration']['host'];
$databaseUser = $GLOBALS['configuration']['user'];
$databasePassword = $GLOBALS['configuration']['pass'];
$databasePort = $GLOBALS['configuration']['port'];
$this->connection = mysql_connect ($serverName.":".$databasePort, $databaseUser, $databasePassword);
if ($this->connection)
{
if (!mysql_select_db ($databaseName))
{
throw new Exception('I cannot find the specified database "'.$databaseName.'". Please edit configuration.php.');
}
if (!mysql_set_charset($GLOBALS['configuration']['encoding'],$this->connection))
{
throw new Exception('I cannot change the charset at the connection with database "'.$databaseName.'". Please edit configuration.php.');
}
}
else
{
throw new Exception('I cannot connect to the database. Please edit configuration.php with your database configuration.');
}
}

------------------------
We'll talk about this in later messages/commits.