I want to pass about 20 variables to mysql table, using PHP scripts. Is there any better way than just doing:
$var1= preg_replace('/[^\w\.\-\& ]/', '', $_GET["var1"]);
$var2= preg_replace('/[^\w\.\-\& ]/', '',($_GET["var2"]));
$var3= preg_replace('/[^\w\.\-\& ]/', '',($_GET["var3"]));
etc.
And then having a massive line of code with:
$query = "INSERT INTO tbl_users (var1, var2, var3 etc.) VALUES('$var1', '$var2', '$var3' etc.)"
Thanks in advance, Sondar