[code=php]
<?php echo $_SESSION[‘cust_id’];
$cust_id= $_SESSION[‘cust_id’];
?>
[code=php]
<div style=”float:left;width:120px;height:22px;padding-top:3px;” id=”l_cust”>Customer Name:</div>
<div style=”float:left;width:640px;height:22px;padding-top:3px;”><input style=”width:600px;border-radius: 8px;-webkit-border-radius: 5px;-moz-border-radius: 5px;” type=”text” name=”customer_name” id=”customer_name” value=”<?php include(‘php_libs.php’); echo valueset(‘customer_details’,’castomer_name’,’$cust_id’); ?> “/></div>
[code=php]
function valueset($table_name,$field_name,$cust_id){
$sql=”select $field_name from $table_name where cust_id=’$cust_id’;”;
include(‘database.php’);
mysql_select_db(“myproject”,$con);
$r=@mysql_query($sql,$con) or die(‘mysql error’);
$row=mysql_fetch_assoc($sql);
/*while ($row = mysql_fetch_assoc($result)) {
}*/
return $r[$field_name];
}
My idea is simple.the perticuler textfield should retain the value of the select query.my DB is MySql.I am trying to work with this code.but its not working.how do i do?i am new to PHP.
kind regads