PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hello,
I'm trying to retrieve multiple rows{ My table has 24 rows}. But my code below displays only the first row. Your help is really appreciated.
Here is my code.
Thanx very much. I have another question. I want to display the values in a form. I mean i want to bind the form to the database and siaply the values in the form. Your help is appreciated. [ I was able to do for single row--but here there are multiple rows and i dont know how to handle them]
<textarea name="NAME" cols="80" rows="6">$WHATEVERVALUE YOU WANT IN HERE(MULTI LINE)</textarea>
//or
<input type="text" name="NAME" value="$WHATEVERVALUE YOU WANT IN HERE(SINGLE LINE)">
$result1 = MYSQL_QUERY("SELECT * from data1 WHERE UserName='$username' order by 'Year' ") or die ("Name and password not found or not matched");
echo "<table border="1" >";
while($worked1 = mysql_fetch_array($result1))
{
$Y_Name1 = $worked1["Year"];
$T_Name1 = $worked1["Type"];
$S_Name1 = $worked1["Subject"];
$V_Name1 = $worked1["Value"];
echo "<tr><td>$Y_Name1 </td>";
echo "<td>$T_Name1</td>";
echo "<td>$S_Name1</td>";
echo "<td>$V_Name1</td></tr>";
}
echo "</table>";
With the above code I'm displaying the contents of the table from the datadase onto a HTML table. I want to display the contents of the table from the database onto a HTML FORM. I mean how do i assign values to the text boxes in the form. I'm confused because I'm having multiple rows.
If it were single row i would do thsi way and it works..Please suggest me what to do for multiple rows.