Hello Buddies,
I have written a script which will retrieve the data from database and gets it displayed on the Web-Browser:
File: retrieve.php
<?php
$con = mysql_connect("localhost","root","mysql123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}mysql_select_db("petp", $con);
$query= "select * from task where Project='" . $_POST['Project'] . "'";
echo $query;
$result= mysql_query($query);
$num_results = mysql_num_rows($result);
echo "<table>\n";
for ($i=0; $i <$num_results; $i++)
{
$row = mysql_fetch_array($result) ;
echo "<tr><td>Project: ", $row['Project'];
echo "<tr><td>List: "; $row['List'];
echo "<tr><td>Assigned: "; $row['Assigned'];
echo "<tr><td>Start: "; $row['Start'];
echo "<tr><td>End: "; $row['End'];
echo "<tr><td>Completion: "; $row['Completion'];
echo "</td></tr>\n";
}
echo "</table>\n";
?>
</body>
</html>
This is throwing output as new line data..bUt All I want is getting it displayed same as :
<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>
</table>
<input type="submit" name="Row" value="submit">
</form>
</body></html>
Also, I want it to be exported into Excel Sheet.
Any PHP Buddy,,,,Who Can HElp me ????