Hi,
i am trying to update a record in an online mysql database. using following php script
i am getting following error in the B4j log
Connected to the database.<br>Error updating record: Unknown column 'abc' in 'field list'
here i am writing abc in the itemname field so that the record value for itemname changes from existing value to abc but it seems that php is considering this abc value as a new column in the table.
i am trying to update a record in an online mysql database. using following php script
B4X:
<?php
$conn = new mysqli("pdb48.awardspace.net", "3373050_restaurant", "abc123", "3373050_restaurant");
if ($conn->connect_error) {
die("ERROR: Unable to connect: " . $conn->connect_error);
}
echo "Connected to the database.<br>";
$id = $_REQUEST['id'];
$name = $_REQUEST['name'];
$price = $_REQUEST['price'];
$sql = "UPDATE menuitems SET itemname=$name WHERE itemid=$id";
if ($conn->query($sql) === TRUE) {
echo "Record Updated successfully";
} else {
echo "Error updating record: " . $conn->error;
}
$conn->close();
?>
i am getting following error in the B4j log
Connected to the database.<br>Error updating record: Unknown column 'abc' in 'field list'
here i am writing abc in the itemname field so that the record value for itemname changes from existing value to abc but it seems that php is considering this abc value as a new column in the table.