I was able to solve this by doing the following:
- the db collation has to be
utf8_general_ci
- the collation of the table with hebrew has to be
utf8_general_ci
- in your php connection script put
header('Content-Type: text/html; charset=utf-8');
- in xhtml head tag put
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- after selecting the db in the connection script put
mysql_query("SET NAMES 'utf8'");