Ik krijg echter steeds de string "<script>document.write(mijnvariable[1])</script>" in mijn 'region' kolom.
Ik zou eigenlijk gewoon de waarde, namelijk 'b' in de region willen krijgen.
Als ik $kiala echo krijg ik gewoon de 'b' te zien, zoals ik zou willen.
Is dit mogelijk?
<script>mijnvariable = [a,b]</script>
$kiala = "<script>document.write(mijnvariable[1])</script>";
echo $kiala; // weergeeft de b zoals het hoort
if(isset($kiala))
{
$servername = "xxx";
$username = "xxx";
$password = "xxx";
$dbname = "xxx";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$sql = "UPDATE customer SET region='$kiala2' WHERE customer_id='1'";
if($conn->query($sql) === TRUE) {
echo "Record updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$conn->close();
}