Why would you want to return a 0 rather than a NULL? Although it is a very, very minute amount of data, and probably doesn't make a difference, I think NULL returns are easier to handle. So, say the value returned is stored in $result, you could to an if statement in the fashion if(!$result), or you could simply do this: if(!$result) { $result = 0; } to automatically do this. I am saying this because I don't think the functions included in MySQL can be rewritten...