可能重复:
在 PHP 中防止 SQL 注入的最佳方法
这是我的 SQL 查询,我想让它没有 SQL 注入
$q1="insert into ecat_user(login_id,password,fullname,gender,disp_name,dob,";
$q1.="street_addr,city,country,zip,email,aol,msn,icq,yahoo,homepg_link,homepg_caption,description,";
$q1.="legal_guardian,phoneno,promotioncode,user_type,height,weight,chest,waist,inseam,eyecolor,haircolor,";
$q1.="shoesize,biceps,collar,experience,travel,notes,added_on,updated_on) values('$modelName','$password','$firstName',";
$q1.="'$gender','$description','$dob','$streetAddress','$city','$country','$zipCode','$emailAddress',";
$q1.="'$aolID','$msnID','$icqID','$msnID','$homePage','$homePageCaption','$description','$legalGuardian',";
$q1.="'$phoneNumber','$promotionalCode','','','','','','','','','','','','','','','','')";
mysql_query($q1, $Conn);
$id = mysql_insert_id();
请建议。