I have a project in which I create a plugin for Wordpress that will allow users to add, delete or update values in the Maria database database.
My syntax is as follows:
try {
$db = new PDO('mysql:host=HOST.mysql;dbname=DBNAME;charset=utf8', 'USERNAME', 'PASSWORD');
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
}
catch (PDOException $e)
{
echo $e->getMessage();
}
This will initialize the contact with the database. If the administrator clicks on the "edit" button, this code will be called.
$updatequery = "UPDATE property SET Seller = '$Seller',
Agent = '$Agent',
Country = '$Country',
City = '$City',
Status = '$Status',
Rentprice = '$Rentprice',
Sellprice = '$Sellprice',
Kitchen = '$Kitchen',
Bedrooms = '$Bedrooms',
Bathrooms = '$Bathrooms',
Rooms = '$Rooms',
Post = '$Post',
Description = '$Description',
Beskrivning = '$Beskrivning',
Caption = '$Caption',
IMG = '$IMG' WHERE ID ='$ID';";
$STH = $db->query($updatequery);
echo "<script>alert('The property has been updated, have a nice day !')</script>";
When I click the edit button. A warning message is displayed, which means that the code has been called. But the values have not been changed. However, despite this, there is no error message, as it was before, when I had fixes for syntax errors that I fixed.
Does the fact that the database runs on MariaDB instead of Mysql mean which syntax will be adopted? Or am I missing something?
MariaDB - 5.5.39-MariaDB.
.