19. Consider the following relational database:
Project (P_Group_No, Project_Title)
Student (Seat no, Name, Class, P_Group_No)
Write a PHP script to accept project title
and display list of students those who are
working in a particular project.
Html file :
<html>
<body>
<form
action="slip_19.php" method="get">
<b>Enter
the title of project :: </b><input type=text name=ptitle><br>
<input
type=submit value=SUBMIT>
</form>
</body>
<html>
Php file :
<?php
$ptitle =
$_GET['ptitle'];
$con
= mysql_connect("localhost","root","");
$d
=
mysql_select_db("bca_programs",$con);
$q
= mysql_query("select s_name
from student_slip19,project where project_title='$ptitle' &&
student_slip19.p_group_no=project.p_group_no");
echo "Student Name :<br>";
while($row =
mysql_fetch_array($q))
{
echo $row['s_name'];
}
mysql_close();
?>
No comments:
Post a Comment
Note: only a member of this blog may post a comment.