Oracle 5.0 Reference Manual page 2439

Table of Contents

Advertisement

20.7.3.9.49. mysqli::set_charset,
Copyright 1997-2012 the PHP Documentation Group. [2230]
mysqli::set_charset
mysqli_set_charset
Sets the default client character set
Description
Object oriented style
bool mysqli::set_charset(
string charset);
Procedural style
bool mysqli_set_charset(
mysqli link,
string charset);
Sets the default character set to be used when sending data from and to the database server.
Parameters
link
charset
Return Values
Returns
TRUE
Notes
Examples
Example 20.142.
Object oriented style
<?php
$mysqli = new mysqli("localhost", "my_user", "my_password", "test");
/* check connection */
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
MySQL Improved Extension (Mysqli)
mysqli_set_charset
Procedural style only: A link identifier returned by
mysqli_connect
The charset to be set as default.
on success or
on failure.
FALSE
Note
To use this function on a Windows platform you need MySQL client library
version 4.1.11 or above (for MySQL 5.0 you need 5.0.6 or above).
Note
This is the preferred way to change the charset. Using
(such as
SET NAMES
set concepts
section for more information.
mysqli::set_charset
or
mysqli_init
utf8) is not recommended. See the
example
2419
to set it
mysqli_query
MySQL character

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 5.0 and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Mysql 5.0

Table of Contents