Update of a field of PHP database question

Hello

I use a box of selection multiple to allow multuple vales is selected and registered in the database

When I add the deposited values I use implode to separate the values with a comma.

$insertSQL = sprintf ("INSERT INTO finance_data (Link_record, Savings_Year, Savings_Trust, Savings_Type, Savings_Amount, Savings_Additional_Notes) VALUES (%s %s %s, %s, %s, %s)",
GetSQLValueString ($_POST ['inserttracker'], "text").
GetSQLValueString ($_POST ['Savings_Year'], "text").
GetSQLValueString ($_POST ['Savings_Trust'], "text").
GetSQLValueString (implode (',', $_POST ['Savings_Type']), "text").
GetSQLValueString ($_POST ['Savings_Amount'], "double").
GetSQLValueString ($_POST ['Savings_Additional_Notes'], "text"));

When I then use an update method, the value appears correctly in the field, however by using the same implode to update the field in the same way does not seem to work and leaves me rather with value null on update

I tried to use different variables and the implode apart from the update even called something else, but I had no luck

update code

If ((isset($_POST["MM_update"])) & & ($_POST ["MM_update"] == "form1")) {}
$updateSQL = sprintf ("UPDATE finance_data SET Link_record = %s Extended_Index = %s Savings_Year = %s, Savings_Trust = %s, Savings_Type =
"%s Savings_Amount = %s Savings_Additional_Notes = %s WHERE Master_index = %s,"
GetSQLValueString ($_POST ['Link_record'], "int").
GetSQLValueString ($_POST ['Extended_Index'], "text").
GetSQLValueString ($_POST ['Savings_Year'], "text").
GetSQLValueString ($_POST ['Savings_Trust'], "text").
GetSQLValueString (implode (',', $_POST ['Savings_Type']), "text").
GetSQLValueString ($_POST ['Savings_Amount'], "double").
GetSQLValueString ($_POST ['Savings_Additional_Notes'], "text").
GetSQLValueString ($_POST ['Master_index'], "int"));

any suggestions would be helpful

Thank you

Krazy Maud wrote:

When I then use an update method, the value appears correctly in the field, however by using the same implode to update the field in the same way does not seem to work and leaves me rather with value null on update

Have you checked if $_POST ['Savings_Type'] is an array? The name attribute of the multiple select element must have an empty pair of brackets like this: