I am building a FORM from DB table "PriceList" that contain information about equipement that you can reserve. I need to save the form submission to a different table "quote_request" where each form line can be save as a record on "quote_request" table.
I have tried many things and I am still missing something. My code is not looping based on the number of line from the form and it is saving only the fisrt line.
I have tried the FOREACH, FOR and while, but I am still missing something.
Query to build the form:
mysql_select_db($database_PriceList, $PriceList); $query_LOCA_SIT = "SELECT * FROM pricelist WHERE EQI_Code = 'SIT' and EQI_Code2 = 'LOCA' ORDER BY EQI_ID"; $LOCA_SIT = mysql_query($query_LOCA_SIT, $PriceList) or die(mysql_error()); $row_LOCA_SIT = mysql_fetch_assoc($LOCA_SIT); $totalRows_LOCA_SIT = mysql_num_rows($LOCA_SIT);
a do/while is always going to execute once before checking the condition. So it's executing and then checking the condition and failing.
I see the while calls mysql_fetch_assoc($LOCA_SPA) but nowhere do I see $LOCA_SPA defined. So unless there's more to your script that you don't have here, it's going to evaluate to false and exit your loop after one round.