Scenario:

My query looks like this:
$query = "SELECT * FROM user_table WHERE userid like '$userid%' OR username like '$username%'";

userid/username is NULL so this is doesn't work out very well. Could some one give details on a good and simple soultion to a wildcard search?