0

Hi guys before I start I want to point out that I have been through the following links and more

How to update multiple columns in mysql using php PHP: Update multiple MySQL fields in single query

I am trying to update a few rows in my database, this is my code:

$stmt = $user->runQuery("SELECT * FROM tbl_client_info WHERE UCODE=:uid");
$stmt->execute(array(":uid"=>$_SESSION['userSession']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);

    if($stmt->rowCount() == 1)
    {
        if(isset($_POST['btn-update-data']))
        {
            $pass = $_POST['pass'];
            $cpass = $_POST['confirm-pass'];
            $name = $_POST['firstname'];
            $lastname = $_POST['lastname'];
            $email = $_POST['billingemail'];
            $cell = $_POST['Cell'];

            if($cpass!==$pass)
            {
                $msg = "<div class='alert alert-block'>
                        <button class='close' data-dismiss='alert'>&times;</button>
                        <strong>Sorry!</strong>  Input Does Not Match. Make sure the details match. 
                        </div>";
            }
            else
            {


                $stmt = $user->runQuery("UPDATE `tbl_client_info` SET 
                    firstname =:name, 
                    lastname =:lastname, 
                    email =:billingemail, 
                    Cell =:cell, 
                    password=:upass, 
                    where UCODE=:uid");

                    $stmt->bindparam(":firstname",$name);
                    $stmt->bindparam(":lastname",$lastname);
                    $stmt->bindparam(":billingemail",$email);
                    $stmt->bindparam(":Cell",$cell);
                    $stmt->bindparam(":upass",$pass);
                    $stmt->execute();

I dont get any errors, but I am pretty sure the problem is in the binding parameters. I only end up getting a Document Moved - This document may be found here page.

Yes I am going to add password_hash ;)

Please any help would be appreciated

Community
  • 1
  • 1
Sean Konig
  • 124
  • 1
  • 12

0 Answers0