I was able to connect my Table from my sql database using the code below
my problem is i want to bind this table into a textbox so that if i click a row in the table...it will automaticall display in an input
value
is this the right way? colored in red
Please Help
Code: Select all
<?php
include("common/payroll_con.php");
$TableName = "tblemployee";
$SQLstring = mysql_query("SELECT * from $TableName");
//$Row = mysql_fetch_row($SQLstring);
//echo "<div id=\"users\">";
echo "<div id=\"lblUser\">Employee Code</div>";
echo "<div id=\"lblName\">Employee Name</div>";
echo "<div id=\"userlist\" > ";
echo "<table style=\"margin:0 auto;\" width:\"100%\" margin-top:\"-15px\">";
while ($Row = mysql_fetch_array($SQLstring)) {
echo "<tr style=\"background:white;\">";
[color=#800000] echo "<td><a href=\"$PHP_SELF?id={$Row['empcode']}\"><span id=\"liUser\">{$Row['empcode']}</span><span id=\"liName\">{$Row['ename']}</span></a></td>";[/color]
echo "</tr>";
}
echo "</table>";
echo "</div>";
?>Code: Select all
<input name="" type="text" value="<? echo $Row['empcode']?>" id="textbox"/>