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!

 

Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.