function SQLString($c, $t){
$c=(!get_magic_quotes_gpc())?addslashes($c):$c;
switch($t){
case 'text':
$c=($c!='')?"'".$c."'":'NULL';
break;
case 'search':
$c="'%%".$c."%%'";
break;
case 'int':
$c=($c!='')?intval($c):'0';
break;
}
return $c;
}