As mentioned earlier you need to make sure that the two vars $type and $slots are set to something before you do the query. Are you giving those two variables values? If this is not then of course it wont find anything WHERE type='$type' AND slots='$slots'.
If these two variables are not set then this is what your query looks like.
$query=mysql_query("SELECT button FROM display WHERE type='' and slots=''");
The above query will not return anything, i dont know how to make this any more clear.
Let me know if this helps,