-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdata.php
More file actions
33 lines (25 loc) · 705 Bytes
/
data.php
File metadata and controls
33 lines (25 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
mysql_connect("localhost","root","");
mysql_select_db("college");
if(isset($_POST['submit']))
{
$name=$_POST['name'];
$school=$_POST['school'];
$roll=$_POST['rollno'];
$result=$_POST['result'];
$query="insert into students(student_name,school_name,roll_no,result) values (' $name','$school','$roll','$result')";
// mysql_query($query);
if(mysql_query($query))
{
// echo "Data Inserted";
echo "<script>alert('Inserted')</script>";
echo "<script>window.open('firstdbCollege.php','_self')</script>";
}
else
{
echo "Unable to Insert Data";
// if (strlen($str) == 0) for blank
//field validation check if the length if the string is 0
}
}
?>