Here is the complete work till date:
Let me explain you I really I want . I created a webpage as shown below:
Code : try.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>frameset with accessibility</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-
8859-1" />
</head>
<frameset cols="200, *">
<frame src="menu.html" name="menu" />
<frame src="content.html" name="content" />
<noframes>
<body>
<p>Your web browser does not support frames. This site also has <a
href="accessible.html"
title="go to the accessible content">alternative, accessible
content</a>.</p>
</body>
</noframes>
</frameset>
</html>
The page you are seeing on the right hand side has the following codes:
<html>
<title>Project Management</title>
<body>
<h1>                                   <u>Create New Project</u>     </h1>
<form name="submit" action="addentry.php" method="post">
<table width="20%" border="1">
<tr>
<td width=45%><b><font face=arial size=2>Project </font></b></td>  
<td><b><font face=arial size=2><input type="text" name= "project_name" value="" >
</font>
</table>
<br>
<table width="100%" border="1">
<td><font size="-1"><b><font face="Arial,Helvetica,sans-serif">List</font></b></font></td>
<td><font size="-1"><b><font face="Arial,Helvetica,sans-serif">Assigned</font></b></font></td>
<td><font size="-1"><b><font face="Arial,Helvetica,sans-serif">Start</font></b></font></td>
<td><font size="-1"><b><font face="Arial,Helvetica,sans-serif">End</font></b></font></td>
<td><font size="-1"><b><font face="Arial,Helvetica,sans-serif"> Completion</font></b></font></body><body></td>
</tr>
<tr>
<td><input type="text" name="list_of_task"></td>
<td>
<select name="assigned_to">
<option>Select</option>
<option>Abhinesh Sethumadhavan</option>
<option>Prabhu Hosmani</option>
</select></td>
<td><input type="text" name="start_date"></td>
<td><input type="text" name="end_date"></td>
<td><input type="text" name="completion_percent"></td>
</tr>
<tr>
<td><input type="text" name="list_of_task"></td>
<td>
<select name="assigned_to">
<option>Select</option>
<option>Abhinesh Sethumadhavan</option>
<option>Prabhu Hosmani</option>
</select></td>
<td><input type="text" name="start_date"></td>
<td><input type="text" name="end_date"></td>
<td><input type="text" name="completion_percent"></td>
</tr>
<td><input type="text" name="completion_percent"></td>
</tr>
<tr>
<td><input type="text" name="list_of_task"></td>
<td>
<select name="assigned_to">
<option>Select</option>
<option>Abhinesh Sethumadhavan</option>
<option>Prabhu Hosmani</option>
</select></td>
<td><input type="text" name="start_date"></td>
<td><input type="text" name="end_date"></td>
<td><input type="text" name="completion_percent"></td>
</tr>
</table>
<input type="submit" name="Row" value="submit">
</form>
</body></html>
When you click on Create New Project it opens up new page on the right side(see above).A user enters few details and when he clicks on Submit button(see below)
On clicking the Submit button, the new page gets displayed saying:
Code for above figure is :
File : addentry.php
<?php
$con = mysql_connect("localhost","root","mysql123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}mysql_select_db("petp", $con);
$sql="INSERT INTO task (Project, List, Assigned, Start, End, Completion) VALUES ('$POST[project_name]','$POST[list_of_task]','$POST[assigned_to]','$POST[start_date]','$POST[end_date]','$POST[completion_percent]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "A New Project Details of $_POST[project_name] has been added successfully";mysql_close($con)
?>
And its working fine.
Now Let us Click on Second Menu Button (Display Project Details)on the left side, it opens up new page on right side as below:
Code : pro32.php
<html>
<body>
<form name="form1" method="post" action="retrieve.php">
<p>Select
<Select Name ="cmbFixedBy" size="1" >
<Option value="NULL"> </option>
<?PHP
$con = mysql_connect("localhost","root","mysql123");
if ($con) mysql_select_db("petp", $con);
else echo "Cannot Connect to Database";
$result = mysql_query("SELECT DISTINCT Project FROM task");
while($row = mysql_fetch_array($result))
{
echo "<option value='". $row['Project']."'>". $row['Project']."</option>";
}
?>
</select>
<input type= submit name="submit">
</form>
</body>
</html>
These are all project names I am trying to retrieve. Ok. Now When I click on Submit Query Button it displays NO OUTPUT.Thats where a HELP I want.
I want to retrieve the database When I select any project NAME and that too in the same format as I see in Figure 1.
All I tried but it shows no output.
Here are list of codes for you I tried with:
File : retrieve.php
<?php
echo "Hello";
$con=mysql_connect("localhost","root","mysql123") or die ("connection wrong");
$db=mysql_select_db("petp", $con) or die ("db");
$query= "select * from task where Project='" . $_POST['cmbFixedBy'] . "'";
echo $query;
$result=mysql_query($query) or die ("query");
if (mysql_num_rows($result)>0){//if has results
echo '<table>';
while ($row=mysql_fetch_array($result))
{
//write your tr using $row[]
echo '<tr><td>'.$row['field_name'].'</td></tr>';
}
echo '</table>';
}
mysql_close($con);
?>
JUST I WANT THE SAME OUTPUT SHOULD COME WHICH IS IN FIRST FIGURE.
Pls Help