I need to Query a database and then populate a textbox input with the result.
I'm trying
Date Called:
<td>
<?php
$selectedSPK=$_POST['SPKSelect'];
$assigned = $_POST['Sales_Exec'];
$date = $_POST['DateSelect'];
if ($selectedSPK)
{
$Call1query = "SELECT Call1 FROM Data WHERE SPKCustNo = '$selectedSPK' ";
$Call1result = mysql_query($Call1query);
while( $row = mysql_fetch_array($Call1result) ){
$Call1 = $row["$Call1Result"];
}
}
?>
<input type="text" name="Call1" id="Call1" value="<?php echo( htmlspecialchars( $Call1) ); ?>"/></td>
But getting nothing out, where am I going wrong, Text inputs seem tricky to populate!
Thankyou!
$Call1 = $row["$Call1Result"];... Give the field names in$row