Hi, I was wondering could anyone help me here. In my program, the user selects a document and fill's it out, submits it and receives an email with the information they filled out in. What I am trying to do now is that when the user selects document and submits it, a number will increment by 1 each time a document is selected.
In my database now I have a field ID, ID increments with each document selection and appears on screen so that is fine. But I have a problem with it when I try do submit a second document, I get an error. I think this has got to do with drop down menu's in my documents - for example drop down menu 1 contains: A, B and C. If I submit a document with A selected once it works, but when I try to select A and submit the document a second time I get an error.
My query is very long but here it is, any help appreciated:
$select_query = "SELECT doc_id FROM tc_tool.forms WHERE
doc_type = '$_POST[doc_type]' AND
doc_number = '$_POST[doc_number]' AND
revision = '$_POST[revision]' AND
cdm_link = '$_POST[cdm_link]' AND
main_req_id = '$_POST[main_req_id]' AND
mars_link = '$_POST[mars_link]' AND
checklist_link = '$_POST[checklist_link]' AND
link_internal_1_3 = '$_POST[link_internal_1_3]' AND
impacted_products = '$_POST[impacted_products]' AND
scope = '$_POST[scope]' AND
impacted_products_2 = '$_POST[impacted_products_2]' AND
review_class = '$_POST[review_class]' AND
full_simplified = '$_POST[full_simplified]' AND
pref_earliest = '$_POST[pref_earliest]' AND
pref_latest = '$_POST[pref_latest]' AND
proj_name = '$_POST[proj_name]' AND
auth_name = '$_POST[auth_name]' AND
req_list = '$_POST[req_list]' AND
optional_list = '$_POST[optional_list]' AND
information_only = '$_POST[information_only]' AND
chairperson = '$_POST[chairperson]' AND
req_reviewers = '$_POST[req_reviewers]' AND
review_duration = '$_POST[review_duration]' AND
document_abstract = '$_POST[document_abstract]'";
$result_query = mysql_query($select_query, $connection);
if ( !$result_query )
die( "Error 1" );
echo mysql_num_rows( $result_query );
if ( mysql_num_rows( $result_query ) != 1 )
die( "Error 2" );
$row = mysql_fetch_assoc( $result_query );
echo $row[ doc_id ];