The PHP script does not execute the MYSQL orders. Why is that? When testing the MYSQL script on the backend it works.
Thanks for any advice! I considered the integer fact. Anyhow.. my query looks like the following and does not work or create any error. INSERT INTO tags (id, tags, giveTake, onOff, tagNumber) VALUES ('1234','jjjjjjjj','0','0','1')
When copying it to the DB backend it works perfectly...
<?php
require_once('XXXX.php');
//Variables for Authentication.
$server_key = md5("XXXXX");
$server_auth = $_POST["XXXXX"];
if($server_auth == $server_key)
{
//Established the connection to the mySQL server.
$connection = new mysqli($server_name, $database_user, $database_password, $database_name);
if($connection)
{
//Variables for userdatabase.
//$firstName = $_POST["userFirstName"];
//$lastName = $_POST["userLastName"];
//$email = $_POST["userEmail"];
//$password = $_POST["userPassword"];
$id = $_POST["id"];
$tags = $_POST["tags"];
$giveTake= $_POST["giveTake"];
$onOff = $_POST["onOff"];
$tagNumber = $_POST["tagNumber"];
// echo $firstName . ' ' . $lastName;
//Getting data from the database.
echo("vor SQL insert");
$sql = "INSERT INTO tags (id, tags, giveTake, onOff, tagNumber) VALUES ('".$id."','".$tags."','".$giveTake."','".$onOff."','".$tagNumber."')";
echo $sql;
$result = mysqli_query($connection, $sql);
echo $result;
if($result)
{
echo ("Success.");
}
else
{
die("Coo0nection Failed.".mysql_connect_error());
echo("Cooonnection Failed.");
}
}
}
else
{
echo("Error.");
}
?>