Welcome Guest, Not a member yet? Register   Sign In
Set charset in mysqli driver
#6

[eluser]zwippie[/eluser]
I cannot test it at the same machine as before (ubuntu 6.06), but get the same error here at home (windows).

MySql server version: 5.0.41-community-nt
MySQL client version: 5.0.41
Code:
Severity: Warning
Message: mysqli_query() expects parameter 1 to be mysqli, string given
Filename: mysqli/mysqli_driver.php
Line Number: 100

After looking into the rest of msqli_driver.php, the solution is obvious:
mysqli_query expects the conn_id as the first parameter, not the last... Smile

So the correct code should be:
Code:
function db_set_charset($charset, $collation)
{
    return @mysqli_query($this->conn_id, "SET NAMES '".$this->escape_str($charset)."' COLLATE '".$this->escape_str($collation)."'");
}


Messages In This Thread
Set charset in mysqli driver - by El Forum - 02-05-2008, 06:38 PM
Set charset in mysqli driver - by El Forum - 02-05-2008, 10:01 PM
Set charset in mysqli driver - by El Forum - 02-06-2008, 12:01 AM
Set charset in mysqli driver - by El Forum - 02-07-2008, 04:03 AM
Set charset in mysqli driver - by El Forum - 02-07-2008, 07:46 AM
Set charset in mysqli driver - by El Forum - 02-07-2008, 10:35 AM
Set charset in mysqli driver - by El Forum - 02-07-2008, 11:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB