Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to Solve PHP Connectivity Error with MySQL

    • 0
    • 0
    • 0
    • 2
    • 0
    • 0
    • 0
    • 615
    Answer it

    <?php

    if(isset ($_POST['Signup']))
    {
    $file_name = $_FILES['image']['name'];
    $file_tmp =$_FILES['image']['tmp_name'];
    $file_ext=strtolower(end(explode('.',$_FILES['image']['name'])));
    $a=$_POST['image'];
    $b=$_POST['name'];
    $c=$_POST['fname'];
    $d=$_POST['add'];
    $e=$_POST['contact'];
    $f=$_POST['email'];
    $g=$_POST['ano'];
    $h=$_POST['qual'];
    $i=$_POST['mimage'];
    $j=$_POST['aod'];
    $k=$_POST['psw'];
    $l=$_POST['psw-repeat'];


    $sql=insert into signup(image, name, fname, add, contact, email, aadhar, qual, degress, ad, psw, con_psw) values ('$a','$b','$c','$d','$e','$f','$g','$h','$i','$j','$k','$l', NOW());

    //store image in folder
    //$folder="/xampp/htdocs/signup/image/";
    //move_uploaded_file($_FILES["myimage"]["tmp_name"], "$folder".$_FILES["myimage"]["name"]);

     move_uploaded_file($file_tmp,"/xampp/htdocs/signup/image/".$file_name);

    if($conn->query($sql)===TRUE)
    {
        echo"You are eligible";
    }
    else
    {
        echo "error".$sql."<br>".$conn->error;
    }

    //session start
    //session_start();

    //storing session data
    //$_SESSION["NAME"]="$b";

    //access session data
    //echo $_SESSION["NAME"];

    // Removing session data
    //if(isset($_SESSION["NAME"])){
      //  unset($_SESSION["NAME"]);
    }

    //destroy session
    //session_destroy();

    //session end
    mysqli_close($conn);

    ?>
     

 2 Answer(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: