Sql works in phpmyadmin but doesnt through php

Hi folks,

im trying to get some records out of my database… this is the part of the php script that creates the query:

$hoofd = urldecode($_GET['main']);
$sub = urldecode($_GET['sub']);
$sql = "SELECT * FROM product WHERE subcat='$sub' AND hoofdcat='$hoofd' ORDER BY naam;";
$res = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($res) == 0){
    echo "Er zijn geen producten om weer te geven!<br />";
}

when I echo my $sql this is what i get:

SELECT * FROM product WHERE subcat='@#$#%' AND hoofdcat='Thomas & Thomas' ORDER BY naam;

when I process this SQL query with Phpmyadmin I just get back the records… when I use my php script it just say ‘Er zijn geen producten…’

Isnt that kind of strange?