Código PHP:
function cargar ($cod_cliente)
{
$sql = "SELECT * FROM cliente WHERE cod_cliente=" . $cod_cliente . ";";
$row = mysql_query($sql);
$this->dni=$row[1];
$this->nombre=$row[2];
$this->apellido1=$row[3];
$this->apellido2=$row[4];
$this->direccion=$row[5];
$this->telefono=$row[6];
}
Código PHP:
$_SESSION['mod_cliente']=new c_cliente;
$_SESSION['mod_cliente']->cargar($_POST['f_cod_cliente']);