Originally posted by laserlight
Change to name="Date_Time[]", and treat the data coming from the drop down menu as an array.
ok so how do I write the code? so that for each selection it gets inserted into the database and where do I put the code? Should it be a function seperate from the global insert statement?
This is the global insert statement as put in by Dreamweaver:
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "vend_reg")) {
$insertSQL = sprintf("INSERT INTO African_vendors (companyName, companyStreetAddress, companyCity, companyState, companyCountry, companyPostal, companyPhone, companyEmail, companyInfo, Date_Time, products_category, products_listing, service_category, service_listing) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['companyName'], "text"),
GetSQLValueString($_POST['companyStreetAddress'], "text"),
GetSQLValueString($_POST['companyCity'], "text"),
GetSQLValueString($_POST['companyState'], "text"),
GetSQLValueString($_POST['companyCountry'], "text"),
GetSQLValueString($_POST['companyPostal'], "text"),
GetSQLValueString($_POST['companyPhone'], "text"),
GetSQLValueString($_POST['companyEmail'], "text"),
GetSQLValueString($_POST['companyInfo'], "text"),
GetSQLValueString($_POST['Date_Time'], "text"),
GetSQLValueString($_POST['products_category'], "text"),
GetSQLValueString($_POST['products_listing'], "text"),
GetSQLValueString($_POST['service_category'], "text"),
GetSQLValueString($_POST['service_listing'], "text"));
I am a newbie at this although I know javascript, but with php, it's taking me a bit longer to figure out how to do the routine.
I tried using that "Date_Time[]" but when inserted into the database, inside of the selections, it wrote, "Array" ....
Thanks for the help.