Here is the Code
<?php
/**
*Author : Tony
*Date : 00-00-00
*File : Auto Quote / custsingle.php
**/
function custsingle( $host, $db, $field, $uid, $table){ //FUNCTION TO GET A SINGLE CUSTOMER
$link = mysql_connect( "$host", "", "") // connect to database //CONNECTION TO MYSQL
or die ( "Could not connect"); //ERROR MSG
mysql_select_db ( "$db") //SELECTS DATABASE
or die ( "Could not select database"); //ERROR MSG
$query = "SELECT * FROM $table WHERE $field = $uid"; //MAKES A QUERY
$result = mysql_query( $query); //GETS RESULTS
while ( $row = mysql_fetch_array ( $result)){
$uid = $row[0];
$custname = $row[1];
$custroad = $row[2];
$custcity = $row[3];
$custpost = $row[4];
$custtelone = $row[5];
$custteltwo = $row[6];
$custfax = $row[7];
$compname = $row[8];
$comproad = $row[9];
$compcity = $row[10];
$comppost = $row[11];
$comptelone = $row[12];
$compteltwo = $row[13];
$compfax = $row[14];
echo "<form action='custupdate.php' method='get'>";
maketabletop( "Auto Quote / Edit Details.", "Customer Information:");
maketabletitle( "Customer Information:");
maketablemiddle ( "Name:", "custname", "$custname");
maketablemiddle ( "Road:", "custroad", "$custroad");
maketablemiddle ( "City:", "custcity", "$custcity");
maketablemiddle ( "Post Code:", "custpost", "$custpost");
maketablemiddle ( "Telephone One:", "custtelone", "$custtelone");
maketablemiddle ( "Telephone Two:", "custteltwo", "$custteltwo");
maketablemiddle ( "Fax:", "custfax", "$custfax");
maketabletitle( "Company Information:");
maketablemiddle ( "Name:", "compname", "$compname");
maketablemiddle ( "Road:", "comproad", "$comproad");
maketablemiddle ( "City:", "compcity", "$compcity");
maketablemiddle ( "Post Code:", "comppost", "$comppost");
maketablemiddle ( "Telephone One:", "comptelone", "$comptelone");
maketablemiddle ( "Telephone Two:", "compteltwo", "$compteltwo");
maketablemiddle ( "Fax:", "compfax", "$compfax");
maketablebottom( );
echo "<input type='hidden' name='uid' value='$uid' border='0'>";
echo "<BR><BR><center><input type='submit' name='' value='Update Details.' border='0'><input type='reset' value='Clear Details.' border='0'></center></form>";
}
}
function maketabletop( $text){
echo "<table width='461' border='1' align='center' cellpadding='0'cellspacing='0' bordercolor='#003366' height='522'>";
echo"<tr bgcolor='#003366' height='38'>";
echo"<td colspan='2' width='484' height='38'><font color='#FFFFFF' face='Verdana, Arial, Helvetica, sans-serif' size='2'><b>$text</b></font></td>";
}
function maketabletitle( $text){
echo"</tr><tr valign='bottom' bordercolor='#FFFFFF' height='34'><td colspan='2' width='484' height='34'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'><b>$text</b></font></td></tr>";
}
function maketablemiddle( $text, $boxname, $variable){
echo "<tr bordercolor='#FFFFFF'>";
echo "<td width='200'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'>$text</font></td>";
echo "<td width='282'><input type='text' name='$boxname' value='$variable' size='37' border='0'><font face='Verdana, Arial, Helvetica, sans-serif' size='2'></font></td>";
echo "</tr>";
}
function maketablebottom( ){
echo"</table>";
}
?>