What database are you using?
select count(*) from diet where uname=@uname,day=@dy,month=@mnth,year=@yr
try instead;
select count(*) from diet where uname=@uname AND day=@dy AND month=@mnth AND year=@yr
If your where-clause is built from multiple filters, use the AND keyword to concatenate them.
I are troll :)