in above line, note the two quotes, in both side of each value.. this is the cause to your DB syntax error.. correct the above line as follows...
($tutor_name,$tutor_contact,$tutor_email,$tutor_profile)";
and try, but investigate for "why you are getting two quotes instead of one quote.
Viraj
[EMAIL PROTECTED] wrote:
Well, I tried that and this is what i got:
INSERT INTO tutor (tutor_name, tutor_contact, tutor_email, tutor_profile) VALUES (''irin'', ''788798878'', ''[EMAIL PROTECTED]'', ''no profile'')
DB Error: syntax error
well, when I echo again, i can successfully see the values I entered. But this time there's a "DB syntax error"????
and when I went into the database to view, it stil reflect a "NULL" value...
-------------------------------------------------------------------------------
On Tuesday 09 December 2003 15:20, [EMAIL PROTECTED] wrote:
This is what I get after I "echo" my query statement:
INSERT INTO tutor (tutor_name, tutor_contact, tutor_email, tutor_profile) VALUES ('NULL', 'NULL', 'NULL', 'NULL')
How come the value is null???
In my INSERT query, I already state my value variable to be the name of the fields in my html. Why is it still inserting "NULL" into the database when I have entered values in the HTML fields?????
$sql = "INSERT INTO tutor (tutor_name, tutor_contact,tutor_email,tutor_profile) VALUES ('$tutor_name', '$tutor_contact', '$tutor_email', '$tutor_profile')";
What could be the problem??
$tutor_name = $db->quote($POST["tutor_name"]); $tutor_contact = $db->quote($POST["tutor_contact"]); $tutor_email = $db->quote($POST["tutor_email"]); $tutor_profile = $db->quote($POST["tutor_profile"]);
You most probably be wanting to use $_POST instead of $POST.