I currently have this code
$main_cat = "Antiques-collectables"; $mcat = "0187-1443"; $sub_cat = "toys"; mysql_query(" INSERT INTO categories (id, main_cat, sub_cat, mcat) VALUES ('', '$main_cat', '$sub_cat', '$mcat') ");
For some reasons the $mcat value is not stored properly . When I check it in the database it appears as "1" , "347" values etc ... only 1 or 3 digits value . I think that the "-" is interpreted by the sql engine as operator . Is there any way to escape it ? I also tried
$mcat = str_replace("-", "\-", $mcat);
but still doesn't work .