I don't know for sure, but most likely it is hashed either via the MySQL PASSWORD() function or one of the PHP hashing functions such as [man]md5/man. With a little trial and error you should be able to determine which. If it was done via MySQL, then your query would be something like:
$sql = "SELECT COUNT(*) FROM `users` WHERE `id`= '$login' AND `password` = PASSWORD('$password')";
If done via PHP hashing, then:
$hashed = md5($password);
$sql = "SELECT COUNT(*) FROM `users` WHERE `id`= '$login' AND `password` = '$hashed'";