PHP Database Handling Program

<body><title>PHP Program</title>
<form name=frminfo method=post>
Enter Roll no.<input type=text name=r1>
                    <input type=submit>

MySQL Table Design :

create database College;

use College;

 Create Table student
    rno numeric(4) Primary key,
    name varchar(20) Not null,
    adres varchar(10)

 insert into student values(1,'Amol K','Pune');
 insert into student values(2,'Biju C','Rajkot');
 insert into student values(3,'Chetan D','Gwalior');


echo "<h3>Accept roll no. of student and display student information from MySQL database.</h3> ";

   $query="Select * from student where rno=" .$rollno;
      echo "<table border=1><tr><td>R.No</td><td>Name</td><td>Address</td></tr>";
      echo "<tr><td>  $row[0]</td><td> $row[1]</td><td>$row[2] </td></tr></table>";
     echo "<h3> Record Not Found</h3>";


No comments:

Post a Comment

Thanks for visiting my Blog!

Have a Question ? Need Help in College Assignments, Need Code that is not available here? Just leave a comment & get your code instantly.

Tips to Enhance Your Blog