paulmo Posted March 20, 2009 Share Posted March 20, 2009 2 forms, 2 queries, 2 db tables, same page. first form (radio buttons) and db connect/insert/echo works, but other form gets 'undefined index' error on text field variable and values not inserted in db or echoed in app. have checked syntax, table/field name, all is right. there are two different tables (interact/user) for each form.i've tried mysql_connect for each form/query, then just one mysql_connect for whole page. the 2 queries are almost identical. help? thanks mysql_connect("xxx", "xxx", "xxx") or die(mysql_error()); mysql_select_db("xxx") or die(mysql_error()); //vv text input query vvmysql_query("INSERT INTO user (name, message, created) VALUES ('$name', '$message', NOW()) ") or die(mysql_error()); second query (radio buttons; this works): mysql_query("INSERT INTO interact (name, theme, created) VALUES ('$name', '$theme', NOW()) ") or die(mysql_error()); Link to comment Share on other sites More sharing options...
justsomeguy Posted March 20, 2009 Share Posted March 20, 2009 Are you trying to submit both forms at once? You can only submit one at a time, and it won't include the values from the other form. Link to comment Share on other sites More sharing options...
paulmo Posted March 20, 2009 Author Share Posted March 20, 2009 Are you trying to submit both forms at once? You can only submit one at a time, and it won't include the values from the other form.negative, these forms would be submitted separately. Link to comment Share on other sites More sharing options...
justsomeguy Posted March 23, 2009 Share Posted March 23, 2009 Well, if you're getting the undefined index notice then the value wasn't submitted with the form. Without seeing the code I couldn't say why. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.