Alternate method to set the char set for mysql within PHP (for API library ver 4.1.7)

I need an Alternate method to set the char set for mysql within PHP.

I attempted to use

<?php
if (!mysqli_set_charset($link, 'utf8'))
{
  $output = 'Unable to set database connection encoding.';
  include 'output.html.php';
  exit();
}
?>

but I get the error “Fatal error: Call to undefined function mysqli_set_charset()”. As best as I can determine, this is because my version of mysql (Client API library version 4.1.7 ) does not support that function.

MySQL version: 5.0.22-community-nt
PHP Version: 5.1.4
Apache Version: 2.0.58 (Win32)

Is there an alternate method of setting the character set within a PHP script that is compatible with the version I am using?

My first experience with mysql was 2 days ago, so I am still in a learning phase.

Thanks,
Steve

As long as you’re just learning, you can just delete all that code entirely. You don’t have to set a connection specific character set, the server’s default will be used instead.

If you want, give http://php.net/manual/en/function.mysql-set-charset.php a try. You might have the mysql extension installed but not mysqli.