how do i convert to bean

$contacts_1_id = $row_cp['contact_id_c'];
$cont_query    = "Select * from contacts where id ='" . $contacts_1_id. "'";
$cont_res      = mysql_query($cont_query);
$row_cont      = mysql_fetch_array($cont_res);
$contact_name = $row_cont['first_name']." ".$row_cont['last_name'];
$primary_address = $row_cont['primary_address_street'].", ".$row_cont['primary_address_city'].", ".$row_cont['primary_address_state'].", ".$row_cont['primary_address_postalcode'].", ".$row_cont['primary_address_country'];
$mobile = $row_cont['phone_mobile'];

how to conveert it to bean format


Source: stackoverflow-php