Jump to content

2 Forms And 2 Queries On Same Page?


paulmo

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...