I have this problem with assigning a certain array
variable. When I post
it to Codeigniter Controller, It produces this error Click to view Image.
View:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
function submit() {
var TableData = {"table1":"sample1","table2":"sample2","table3":"sample3"};
var Data = JSON.stringify(myTableArray);
$.ajax({
type: "POST",
url: "http://janncomputing/tabulation/judges/save_Production",
data: {pTableData : Data},
success: function(result){ //retrieve data
alert('Success');
alert(result); //alert it
}//success
});
</script>
</head>
<body>
<div>
<button type="button" onClick="submit();">SUBMIT</button>
</div>
</body>
</html>
Controller:
public function save_Production()
{
$table = json_decode($_POST['pTableData'],true);
$msg = $table['table1'];
echo $msg;
}