0

I have been knocking my head over this for hours now but still i cant see where i m going wrong. Please refere to code below

try
        {   

            $stmt1 = $db_con->prepare("SELECT * FROM users_profile WHERE email= :email ");
            $stmt1->execute(array(":email"=>$email));
            $count = $stmt1->rowCount();

            if($count==0){

            $stmt = $db_con->prepare("INSERT INTO users_profile(referencecode,name,surname,cellphone,email,address,region,password,datejoined,amount,status) VALUES(?,?,?,?,?,?,?,?,?,?,?)");
            $stmt->bind_param("sssssssssss",$reference,$name,$surname,$cellphone,$email,$address,$region,$password,$joining_date,$amount,$status);


                if($stmt->execute())
                {
                    echo "registered";
                }
                else
                {
                    echo "Query could not execute !";
                }

            }
            else{

                echo "1"; //  not available
            }

        }
        catch(PDOException $e){
            echo $e->getMessage();
        }
    }

This is my table structure Users_profile

I know the question has been asked a million times, but whatever solution i try it doesnt work for me. Maybe its something in my code i am oversighting.

codex
  • 1
  • 5

0 Answers0