Jump to content

Is SET NAMES properly place inside this method?


co.ador

Recommended Posts

I have set up SET NAMES in the method below don't know if it is properly placed any suggestions becuase the rating system still doesn't work and want to know if The SET NAMES is all set and continue looking for another possible source for the problem.

 

 

<?php    public static function ExecuteQuery( $sql, $name)
      {
        if (self::$connection)
        {
          if (strlen(trim($name)) != 0)
          {
            switch (self::$type)
            {
              case "mysql":
                if (!array_key_exists($name, self::$savedQueries))
                {
                  self::$savedQueries[$name] = @mysql_query( "SET NAMES 'utf8'", $sql, self::$connection) or Error::LogError("Query Failed", mysql_error(self::$connection));
                }
                break;
              case "mysqli":
                if (!array_key_exists($name, self::$savedQueries))
                {
                  self::$savedQueries[$name] = @mysqli_query(self::$connection, $sql) or Error::LogError("Query Failed", mysqli_error(self::$connection));
                }
                break;
            }
            
            return self::$savedQueries[$name];
          }?> 

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.