Hello:
I was wondering whether I could get a second pair of eyes on a query. I can't seem to find the problem.
I'm trying to run this query and I'm receiving the following message:
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 'condition, exc_comments, good_comments, fair_comments, fair' at line 3
I've used this query in other scripts, using different table names and fields, and the query worked without a problem. I don't know why this particular one isn't working.
I hope someone can help me out. Thank you in advance. Here's the query.
$query8 = "REPLACE INTO discharge_summary (client_id, now1_date, discharge_name, discharge_address, discharge_city, discharge_state, discharge_zip, discharge_phone,
discharge_relation, type_id, discharge_date, services_received, present_mood, rep_name, rep_address,
rep_city, rep_state, rep_zip, rep_phone, rep_amount, left_desire, left_undesire, condition,
exc_comments, good_comments, fair_comments, fair_poor_comments, poor_comments, notify, notify_relation,
services_summary, summary_goals, summary_problems, summary_needs)
VALUES ('$_POST[client_id]', '$_POST[now1_date]', '$_POST[discharge_name]', '$_POST[discharge_address]', '$_POST[discharge_city]', '$_POST[discharge_state]',
'$_POST[discharge_zip]', '$_POST[discharge_phone]', '$_POST[discharge_relation]', '$_POST[type_id]', '$_POST[discharge_date]',
'$services_received3', '$_POST[present_mood]', '$_POST[rep_name]', '$_POST[rep_address]', '$_POST[rep_city]',
'$_POST[rep_state]', '$_POST[rep_zip]', '$_POST[rep_phone]', '$_POST[rep_amount]', '$_POST[left_desire]', '$_POST[left_undesire]',
'$condition3', '$_POST[exc_comments]', '$_POST[good_comments]', '$_POST[fair_comments]', '$_POST[fair_poor_comments]', '$_POST[poor_comments]',
'$_POST[notify]', '$_POST[notify_relation]', '$_POST[services_summary]', '$_POST[summary_goals]', '$_POST[summary_problems]',
'$_POST[summary_needs]')";
$result8 = mysql_query ($query8) or die ("Query error:<br>$query8<br>".mysql_error());