mgtm3
asked on
why i cant insert into a field in a table in mysql things like "." "?" "," ?????
i have a field in a table and i want to insert in it this symbols
?
.
,
'
but its not working
why is that?
?
.
,
'
but its not working
why is that?
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Try this, if that doesnt work, tell me what error you are getting.
Regards,
Vibrazy
Regards,
Vibrazy
$f = "INSERT INTO $pollname (op1,op2,op3,op4,op5,subject,gen) VALUES ('".$op1."','".$op2."','".$op3."','".$op4."','".$op5."','".$subject."','".$gen."')";
mysqli_query($link,$f);
ASKER
can u write me the function to get the error ?
ASKER
o.k this what i got
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Day','Valentine's Day','Favorite holiday?','other')' at line 1
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's Day','Valentine's Day','Favorite holiday?','other')' at line 1
SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
thanksssssssssssssssss
You can also do the following instead of individually changing the values
foreach($_POST as $key => $val){
${$key} = mysql_real_escape_string($val);
}
ASKER
Open in new window