How could I read out only a part of a database column?
Posted by: DAniel Hofmann
Date: April 19, 2020 04:26AM

Hey,

i have a entry in a database column as the following:


[{"id":"1","is_email":"false","add_to_day_hour_info":"false","add_to_day_hour_body":"false","translation":"Naam:","value":"J.van Roode"},{"id":"2","is_email":"false","add_to_day_hour_info":"false","add_to_day_hour_body":"false","translation":"Straatnaam \/ huisnummer:","value":"Boswilg 25"},{"id":"7","is_email":"false","add_to_day_hour_info":"false","add_to_day_hour_body":"false","translation":"Postcode:","value":"1853AA"},{"id":"9","is_email":"false","add_to_day_hour_info":"false","add_to_day_hour_body":"false","translation":" Plaatsnaam:","value":"Heiloo"},{"id":"10","is_email":"false","add_to_day_hour_info":"false","add_to_day_hour_body":"false","translation":"Telefoonnummer:","value":"0725615318"},{"id":"3","is_email":"true","add_to_day_hour_info":"false","add_to_day_hour_body":"false","translation":"Email","value":"J.vanroode@ziggo.nl"},{"id":"19","is_email":"false","add_to_day_hour_info":"false","add_to_day_hour_body":"false","translation":"LET OP !! U ontvangt de bevestiging alleen per E-mail.","value":"true"},{"id":"29","is_email":"false","add_to_day_hour_info":"false","add_to_day_hour_body":"false","translation":"Ja, Ik ga accoord met de reserveringsvoorwaarden van enjoybooking, en de nieuwe algemene verordening persoonsgevens ","value":"true"},{"id":"24","is_email":"false","add_to_day_hour_info":"false","add_to_day_hour_body":"false","translation":"Bijzonderheden:","value":"Als er is graag balkon "}]


Now I want to read out only the LAST ID Field with the Bijzonderheden Part in the last text section and I only need to display the value:

"Als er is graag balkon"

The column in the database is called "form" - how could I only read out this part of the entry and not the whole entry?

At the moment I read it out with the following command:


if( !in_array( 'Bijzonderheden', $csvReservationHeader ) ) {
array_push($csvReservationHeader, 'Bijzonderheden');
}
array_push($csvReservation, $reservation['form']);
array_push($excelReservationsData, '<td>'.$reservation['form'].'</td>');

if (!array_key_exists('form', $jsonReservationsData)) {
$jsonReservationsData['form'] = array();
}
@array_push($jsonReservationsData['form'], $reservation['form']);


Hope to get help from you :-)

Best regards
Daniel

Options: ReplyQuote


Subject
Views
Written By
Posted
How could I read out only a part of a database column?
275
April 19, 2020 04:26AM


Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.