Function is running properly and my other query of inserting data is also running perfectly which is commented below.
This is the error i am getting "Error: SELECT MAX(product_id) FROM product_attribute "
public function add_tbl1($attribute_id , $attribute_description){
$con=$this->con;
$id = mysqli_real_escape_string($con, $attribute_id);
$description = mysqli_real_escape_string($con, $attribute_description);
$sql2="SELECT MAX(product_id) FROM product_attribute ";
$no=0;
if ($con->query($sql2) === TRUE) {
$no= $con->query($sql2);
$no=$no+1;
echo $no;
} else {
echo "Error: " . $sql2 . "<br>" . $con->error;
}
/*$sql = "INSERT INTO product_attribute ( attribute_id, attribute_description)
VALUES ( '$id', '$description')";
if ($con->query($sql) === TRUE) {
echo "New record created successfully";
} else {
echo "Error: " . $sql . "<br>" . $con->error;
} */
}