This topic is locked

Mysql character set settings

3/12/2009 11:30:00 AM
PHPRunner General questions
J
jacekq author

Hi,
Congratulations for you for implementing 'Ouput code page' on Misc screen!

But there should be also done some configuration for setting up MySQL connection.

I've seen the following code in 'dbconnection.my.php':

##if @BUILDER.strMYSQLNames!="" ##

@mysql_query("set names ##@BUILDER.strMYSQLNames s##");

##endif##


But I can't see setting for 'BUILDER.strMYSQLNames' so I have to place manualy the line:

@mysql_query("set names latin2");


to have proper connection to MySQL server!
Are you going to implement configuration of connection to MySQL server?
Best Regards,

Jacek

D
danaci 3/12/2009

dbconnection.php
<?php
function db_connect()

{

global $host,$user,$pwd,$errstr,$sys_dbname,$port,$bSubqueriesSupported;

$strhost=$host;

if($port && $port!=3306)

$strhost=$strhost.":".$port;

$conn = mysql_connect($strhost,$user,$pwd);
mysql_query("SET NAMES 'latinx'");

mysql_query("set SESSION character_set_client = latinx ");

mysql_query("set SESSION character_set_connection = latinx ");

mysql_query("set SESSION character_set_results = latinx ");