Click to See Complete Forum and Search --> : is it error with @ sign?


fireblade
06-12-2007, 01:37 AM
I am gettin an erro msg when trying to enter my newsletter registration details to the database.


function process_nl($id) {
$name=$_POST['txtname'];
$email=$_POST['txtemail'];
$SQL = "INSERT INTO nletter (name, email) VALUES ($name, $email)";
if(mysql_query($SQL,$id)) {
return true;
exit;
}
else
return false;
}


error
You have an error in your SQL syntax near '@yahoo.com)' at line 1


is it a problem vth the @ symbol?? How can i do this?? please explain me the way to convert the @ symbol and process the job done..

NogDog
06-12-2007, 02:07 AM
Non-numeric values must be quoted:

$SQL = "INSERT INTO nletter (name, email) VALUES ('$name', '$email')";

fireblade
06-12-2007, 02:42 AM
oh is it?? I'll check it and reply..

and another thing i want to know..
I am going to use database for uploading and retreiving article from a single page. Is it possinbe me to save datas that contains HTML codes and URL links inside a TEXT data field of my sql??

If any one can give me a link or explaination to furhter study abt this it would be more help ful to me..
thanks in advance...