Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "root";
- $password = "";
- $database = "test";
- // Create connection
- $conn = mysqli_connect($servername, $username, $password, $database);
- // Check connection
- if (!$conn) {
- die("Connection failed: " . mysqli_connect_error());
- }
- echo "Connected successfully";
- $value1=$_POST['txtname'];
- $value2=$_POST['cellnumber'];
- $value3=$_POST['dist'];
- $value4=$_POST['specialization'];
- $value5=$_POST['membername'];
- $value6=$_POST['date'];
- $sql = "INSERT INTO students (StudentName, CellNumber, District, Specialization, PromotionMember, Date)
- VALUES ('$value1', '$value2', '$value3', '$value4', '$value5', '$value6')";
- if (!mysqli_query($sql)) {
- die ('Error: ' . mysql_error());
- }
- else
- {
- echo ("معلومات ارایه شده شما ثبت شد");
- header("Location: register.html");
- }
- mysqli_close();
- ?>
- mysqli_query($sql)
- mysqli_query($conn, $sql)
- $sql = "INSERT INTO students (StudentName,CellNumber, District, Specialization, PromotionMember, Date)VALUES ('$value1', '$value2', '$value3', '$value4', '$value5', '$value6')";
- $q=mysqli_query($conn,$sql);
- if (!$q) {
- die ('Error: ' . mysqli_error($conn));
- }else{header("Location: register.html");}
- $sql = "INSERT INTO students (StudentName, CellNumber, District, Specialization, PromotionMember, Date)
- VALUES ('$value1', '$value2', '$value3', '$value4', '$value5', '$value6')";
- $qw=mysqli_query($conn,$sql);
- if($qw)
- {
- header("Location: register.html");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement