Cannot insert data in the database using option(textarea)

前端 未结 2 384
温柔的废话
温柔的废话 2021-01-29 15:13

I got this code but it is not inserting the content of the option (textarea) into the database.

connection.php



        
2条回答
  •  深忆病人
    2021-01-29 15:31

    You need to name your select with name=food or something so it will be in $_POST['food']. Each option in the select does not show up in $_POST, only what is selected will be in the name of the select. Each option is not it's own thing.

    
    

    When you save the data it will have:

    $_POST['food'] with the value of 'foodA' if multiples, it will be 'foodA, foodB'
    

提交回复
热议问题