从这样的另一个函数调用函数时,我没有发现错误:
函数 PHP
class DB_Functions extends DB_Connect{
private $dbConnect = "";
public function __construct() {
$this->dbConnect = $this->pdo_connect();
}
public function __destruct() {
$this->dbConnect = null;
}
public function actionOnProfile() {
//MORE CODE
$id = $this->dataActionProfile['id'];
$nombre = $this->dataActionProfile['nombre'];
$descrip = $this->dataActionProfile['descrip'];
updateprofile($nombre, $descrip, $id);
}
function updateprofile($nombre, $descrip, $id) {
$sql = "UPDATE cat_perfiles SET Nombre = :nom, Descripcion = :des WHERE Id = :id";
$result = $this->dbConnect->prepare($sql) or die ($sql);
$result->bindParam(':nom',$nombre,PDO::PARAM_STR);
$result->bindParam(':des',$descrip,PDO::PARAM_STR);
$result->bindParam(':id',$id,PDO::PARAM_INT);
if (!$result->execute()) {
return false;
}
$jsonErrorProfile = array();
$jsonErrorProfile['success'] = 'success';
return $jsonErrorProfile;
}
}
错误是使用updateprofile($nombre, $descrip, $id);
错误:500 内部服务器错误