We help IT Professionals succeed at work.
Get Started

mysqli, getting warning message that won't go away

elepil
elepil asked
on
276 Views
Last Modified: 2015-05-12
I am using mysqli. I'm trying to update a user record. The update DOES succeed, but I am getting a slew of warning message for each and every single column involved in the update. Here is the code snippet which looks long, but the length is really irrelevant:

mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_ALL); // Turn on Exceptions
    $sql = " UPDATE users " .
               "     SET username = ?, " .
               "	 password = ?, " .
               "         firstname = ?, " .
               "         middlename = ?, " .
               "         lastname = ?, " .
               "         address1 = ?, " .
               "         address2 = ?, " .
               "         city = ?, " .
               "         state = ?, " .
               "         zipcode = ?, " .
               "         phone1 = ?, " .
               "         phone2 = ?, " .
               "         email = ?, " .
               "         canHaveAppts = ?, " .
               "         eFiler = ?, " .
               "         apptColor = ?, " .
               "         notes = ?, " .
               "	 editdate = now(), " .
               "         editedbyid = ? " .
               " WHERE userid = ? ";
    
    $db = DB::getMYSQLIConnection();
    $stmt = $db->prepare($sql);
    $stmt->bind_param('sssssssssssssssisii', 
                      $u->username, $u->password, $u->firstname,
                      $u->middlename, $u->lastname, $u->address1,
                      $u->address2, $u->city, $u->state, $u->zipcode,
                      $u->phone1, $u->phone2, $u->email, $u->canHaveAppts,
                      $u->eFiler, $u->apptColor, $u->notes, $u->userid,
                      $u->userid);

    $retValue = $stmt->execute();
    if ($retValue === 0) {
        $message = 'From updateUser_mysqli(): FATAL ERROR! Updated FAILED! Call the Administrator. userid=' . $u->userid;
        throw new Exception($message);
    }

Open in new window


Here is the warning message I am getting for EACH AND EVERY column: (I am just showing the first few)

[08-May-2015 14:47:03 America/Los_Angeles] PHP Notice:  Indirect modification of overloaded property User::$username has no effect in C:\xampp\htdocs\newdimension\public\test\EEQuestion01.php on line 36

[08-May-2015 14:47:03 America/Los_Angeles] PHP Stack trace:

[08-May-2015 14:47:03 America/Los_Angeles] PHP   1. {main}() C:\xampp\htdocs\newdimension\public\test\EEQuestion01.php:0

[08-May-2015 14:47:03 America/Los_Angeles] PHP Notice:  Indirect modification of overloaded property User::$password has no effect in C:\xampp\htdocs\newdimension\public\test\EEQuestion01.php on line 36

[08-May-2015 14:47:03 America/Los_Angeles] PHP Stack trace:

... and so on ... for every single column, I get the same warning.

Open in new window


How do I get rid of this warning message? I googled this, actually saw a post from PHP site where the person who posted said this was a bug, but a responder said it wasn't. In short, I end up with no solution (see https://bugs.php.net/bug.php?id=40625). The last response was on 2013, so I'm hoping people have had time find a resolution to this?

Thanks.
Comment
Watch Question
Most Valuable Expert 2011
Author of the Year 2014
Commented:
This problem has been solved!
Unlock 2 Answers and 11 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE