SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict peterb's Avatar
    Join Date
    Jun 2003
    Location
    Athens, Greece
    Posts
    283
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysql_query and set parameters

    Hello all,

    I have been checking some update information regarding the newer version of mysql.
    As I have been using:
    Code:
            mysql_query("SET 
                        character_set_results = 'utf8', 
                        character_set_client = 'utf8', 
                        character_set_connection = 'utf8', 
                        character_set_database = 'utf8', 
                        character_set_server = 'utf8'", $link);
                        mysql_set_charset('utf8',$link);
    I noticed in http://php.net/manual/en/function.mysql-set-charset.php that mysql_set_charset will be deprecated as of PHP 5.5.

    My question is whether it is better to use the mysql_query set as above or to code it this way
    Code:
    mysql_query("SET CHARACTER SET 'utf8'");
    ?

    Also, is there an underscore version of
    Code:
    mysql_query("SET NAMES 'UTF8'");
    ?

  2. #2
    SitePoint Addict peterb's Avatar
    Join Date
    Jun 2003
    Location
    Athens, Greece
    Posts
    283
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    anyone?

  3. #3
    Utopia, Inc. silver trophy
    ScallioXTX's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    9,031
    Mentioned
    152 Post(s)
    Tagged
    2 Thread(s)
    All mysql_ functions have been deprecated as of PHP 5.5 and the mysqli_ or PDO need to be used instead, as stated in the manual, so it's best to move away from the mysql_ functions entirely.
    Rémon - Hosting Advisor

    Minimal Bookmarks Tree
    My Google Chrome extension: browsing bookmarks made easy

  4. #4
    SitePoint Addict peterb's Avatar
    Join Date
    Jun 2003
    Location
    Athens, Greece
    Posts
    283
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, I will have a look at that.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •