1
$up = $this->db->prepare ("
        UPDATE ".self::DbUser." SET UserLogin=:UserLogin WHERE UserId=:UserId; 
        UPDATE ".self::DbUProfile." SET ProfileName=:ProfileName, ProfilePhone=:ProfilePhone WHERE ProfileUserId =:UserId");

$up->bindValue (':UserLogin', $UserLogin);
$up->bindValue (':ProfileName', $ProfileName);
$up->bindValue (':ProfilePhone', $ProfilePhone);
$up->bindValue (':UserId', $UserId);

if ( !$up->execute() )...

As a result: General error: 25 bind or column index out of range

What is a problem? Thanks!

Barmar
  • 596,455
  • 48
  • 393
  • 495

1 Answers1

1

The documentation for execute says (found through this question):

The keys from input_parameters must match the ones declared in the SQL. Before PHP 5.2.0 this was silently ignored.

Try splitting the query in two, and for each execute specify only parameters that are used?

Andomar
  • 216,619
  • 41
  • 352
  • 379