Jump to content

Fatal error: Call to undefined function mysql_set_charset()


g_p_java

Recommended Posts

Hello,

 

i use MySQL with PHP.

My php version is 5.2.0.

After i connect to the db i use mysql_set_charset in order to change the system variables (character_set_client , character_set_results ,character_set_connection).

i do:

 

if (USE_PCONNECT == 'true') {
      $$link = mysql_pconnect($server, $username, $password);
      mysql_set_charset('utf8',$$link);
      } else {
      $$link = mysql_connect($server, $username, $password);
      mysql_set_charset('utf8',$$link);  
    }

 

I take the error: Fatal error: Call to undefined function mysql_set_charset().

 

In the manual page for mysql_set_character says:

1."(PHP 5 >= 5.2.3)" --> that means that i have an old php version??

2."Note: This is the preferred way to change the charset. Using mysql_query() to execute SET NAMES .. is not recommended. "

 

What shall i do in order to solve my problem??

 

thanks, in advance!

 

Hello g_p_java

 

You are 3 revisions shy of having a new enough version of PHP. I would definitely upgrade, to a newer version of PHP 5.2.x (I think it's 5.2.14 now) I doubt any code will break by doing this, so it should be pretty easy for ya.

 

Cheers

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.