I have a project where I am creating a plugin for WordPress which will allow users to add, delete, or update values in a Maria DB 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 contact with the database. If the admin clicks on the "edit" button then this code will be summoned.
$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 on the edit button. The alert message is displayed which means the code was summoned. But the values have not been changed. Yet inspite of this there is no error message as there was earlier when I had syntax errors that I corrected.
Does the fact that the database runs on MariaDB instead of MySQL have any impact on what kind of syntax will be accepted? Or am I missing something?
The MariaDB version is 5.5.39-MariaDB.