hi
i built a simple function that get a string of a username ,search the db and check if it exsist.
the problem is when i enter an hebrew string (of a username that exist in db)
the function in IE returen that it isnt exist and on FF it works fine (return true - the user exsist)
(when i enter an english username the function forks fine for the both of the browser)
all my pages encoded as utf-8 including my db.
what seems to be the problem?
thx.
problem with php+mysql
Moderator: General Moderators
Re: problem with php+mysql
Weird... if it works in Firefox it should work with IE as well. I doubt it would help, but... show us your code.
Re: problem with php+mysql
the function uses ajax so ill copy only the relevant lines:
calling the function:
js file:
searchdb.php:
calling the function:
Code: Select all
<input type="text" onblur="checkuser(this.value)" name="username" dir='rtl' size="15" />Code: Select all
function checkuser(t)
{
searchdb(t);
}Code: Select all
function searchdb(name)
{
http.open('get', 'searchdb.php?user='+name);
http.onreadystatechange = handleResponse;
http.send(null);
}Code: Select all
$query="SELECT * FROM
users WHERE (username = '$_GET[user]'
)";
$result=mysql_query($query);
$row = mysql_fetch_array($result, MYSQL_NUM);
if($row[0])
echo "1";
else
echo "0";Re: problem with php+mysql
Did you check your function without ajax?