Data insert Error in Wamp 3.0.6 mysql 5.7.14
Posted by: pateldh (210.212.67.---)
Date: July 15, 2017 06:10AM

Hi, I am getting error in Data insert. following is th code.

Database name is : stores

table name: emp_registration

Fields are :
id (Primary Key & Auto increment), firstname(varchar),

	include "connection.php";
<!DOCTYPE html>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Employee Registration Form | SMS </title>
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="css/animate.min.css" rel="stylesheet">
    <link href="css/custom.min.css" rel="stylesheet">
<div class="col-lg-12 text-center ">
    <h1 style="font-family:Lucida Console">Stores Management System</h1>
<body class="login" style="margin-top: -20px;">
    <div class="login_wrapper">

            <section class="login_content" style="margin-top: -40px;">
                	<form  name="form1" method="post" action="">
                    <h2>User Registration Form</h2><br>
                        <input type="text" class="form-control" placeholder="FirstName" name="firstname" required/>
                        <input type="text" class="form-control" placeholder="MiddleName" name="middlename" required/>
                        <input type="text" class="form-control" placeholder="LastName" name="lastname" required/>
                        <input type="text" class="form-control" placeholder="Username" name="username" required/>
                        <input type="password" class="form-control" placeholder="Password" name="password" required/>
                        <input type="text" class="form-control" placeholder="email" name="email" required/>
                        <input type="text" class="form-control" placeholder="contact" name="contact" required/>
                        <input type="text" class="form-control" placeholder="SEM" name="sem" required/>
                        <input type="text" class="form-control" placeholder="Enrollment No" name="enrollmentno" required/>
                    <div class="col-lg-12  col-lg-push-3">
                        <input class="btn btn-default submit" type="submit" name="submit1" value="Register">

    $qry=mysqli_query($link,"insert into  emp_registration
        &lt;div class=&quot;alert alert-success col-lg-12 col-lg-push-0&quot;&gt;
        Registration successfully, You will get email when your account is approved

After filling all fields data cannot insert but registration sucessfully msg comes. please help me what anything going wrong.
my Whatsapp no : +91 9327823000
: +91 9727731765

Please suggest or contact on above number

Edited 3 time(s). Last edit at 07/15/2017 04:04PM by RiggsFolly.

Options: ReplyQuote
Re: Data insert Error in Wamp 3.0.6 mysql 5.7.14
Posted by: RiggsFolly (Moderator)
Date: July 15, 2017 04:13PM


This is not the site for getting assistance with fixing PHP code. However I have a few suggestions that might help you

Your script is at risk of SQL Injection Attack Even
if you are escaping inputs, its not safe!
Use prepared parameterized statements

(Windows 7 Pro 32bit) (Wampserver 3.1.3 32bit & 64bit)
<Apache 2.4.29/2.2.31> <PHP 7.2/7.1/7.0/5.6/5.5/5.4> <MySQL 5.7.19/5.6.39/5.5.28>
<MariaDB 10.2.14> <phpMyAdmin4.8.1> <MySQL Workbench 6.3.10>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin -- WAMPServer alternate Repo
-?-?-?- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -?-?-?-

Options: ReplyQuote

Sorry, only registered users may post in this forum.