The $data variable stores an array containing a username and password, which need to be inserted in a certain table.
$data = array('username' => $username, 'password' => $password);
foreach($data as $key => $value){
$values = $values . "'" . $value . "'" . ",";
}
$sql = "INSERT INTO table(username, password) VALUES (?, ?)";
$query = $con->prepare($sql);
$query->execute($values);
How can I change this code in such a way that it will print the values of the $values variable into the execute function? E.g. 'Newuser','mysecretpass'