I am trying to update database with php update function but it always goes to else
It seems to me the no syntax error
function UpdateData()
{
$bookid = textboxValue("book_id");
$bookname = textboxValue("book_name");
$bookpublisher = textboxValue("book_publisher");
$bookprice = textboxValue("book_price");
if($bookname&&$bookpublisher&&$bookpublisher){
$sql="UPDATE books SET book_name='$bookname', book_publisher='$bookpublisher', book_price='$bookprice' WHERE id='$bookid' ";
if(mysqli_query($GLOBALS['con'],$sql)){
TextNode("success",'data successfully update');
}else{
TextNode("error","enable to update data");
}
}else{
TextNode("error","select data using edit icon");
}
}
Error:
No data sources are configured to run this SQL