Categories
Mastering Development

insert data using prepare statement

hello guy i want to insert data from radio,checkbox, input and image file using prepare statement in PHP but if a run the program it bring me this error message which I don’t understand Fatal error: Uncaught Error: Call to a member function bind_param() on bool in /opt/lampp/htdocs/nesthet/backend/test_result_script.php:63 Stack trace: #0 /opt/lampp/htdocs/nesthet/test_result.php(2): include() #1 {main} […]

Categories
CMS Magento Mastering Development

magento 1.9 show zipcode and addess at time of registration

I am trying to show the zip code and address field only so had to override only phtml file app/design/frontend/theme/folder/template/opc/customer/form/register.phtml and commented the code but showing the errors for country, telephone, etc how I can avoid this errors can anyone help me in this thanks in advance

Categories
Mastering Development

Search for key inside nested lists inside nested dictionaries

The original post is Go through json line by line including unkown nested arrays and objects I am trying to search for a specific value in all nested lists and nested dictionaries inside a JSON dictionary. The structure of the dictionary is not always known. The nested dictionary can have a nested list. The key […]

Categories
Mastering Development

translate response and request in PHP REST API

I am still struggling with a logic how to translate correctly the response and the request for my PHP REST API. I have following array which I get from the REST API [{ “id”: “49557a36-028b-40c6-b2d8-8095468af130”, “startDate”: “2020-04-15T06:00:00Z”, “endDate”: “2020-04-15T10:00:00Z”, “bookedOn”: “0001-01-01T00:00:00”, “doctorNotes”: “”, “firstVisit”: true, “visitReasonID”: “”, “patient”: { “firstName”: “”, “lastName”: “”, “birthday”: “0001-01-01T00:00:00”, […]

Categories
Mastering Development

Missing and inaccurate payload in Rails with ActiveModel and Forms

I have a model for Organisation like class Organisation include ActiveModel::Model attr_accessor :orguid, :title, :firstname, :lastname, :role, :telephone, :extension, :email, :name, :branch, :address1, :address2, :address3, :city, :state, :country, :zip end In my controller I have the following actions: # frozen_string_literal: true require ‘cgi’ require ‘json’ class OrganisationsController < ApplicationController include Secured before_action :set_api, only: %i[dashboard […]

Categories
Development

‘serving_default’ : Classification input must be a single string Tensor

I’m building a very simple Classifier. The input data has the following features job object marital object education object default int64 housing int64 loan int64 contact object dayofmonth object month object duration int64 campaign int64 pdays int64 previous int64 poutcome object First version of the serving function def serving_input_receiver_fn(): feature_spec = { ‘job’ : tf.placeholder(dtype […]

Categories
CMS Development Drupal

How to define default values in case of no results of a query? [closed]

I use this query on custom content entities to define default values for a form: $database = \Drupal::database(); $query = $database->select(‘member’, ‘am’); $query->leftJoin(‘person’, ‘ap’, ‘ap.member_id = am.id’); $query->fields(‘ap’, [‘id’, ‘lastname’, ‘firstname’, ’email’, ‘cellphone’, ‘iscontact’]) ->fields(‘am’, [‘id’, ‘designation’, ‘addresssupplement’, ‘street’, ‘postalcode’, ‘city’, ‘contact_id’, ‘telephone’, ‘status’]) ->condition(‘am.contact_id’, $iCurrentUserId, ‘=’) ->orderBy(‘iscontact’, ‘DESC’); $results = $query->execute()->fetchAll(); The query may […]

Categories
CMS Development Drupal

How to define default values in case of no results of a query? [closed]

I use this query on custom content entities to define default values for a form: $database = \Drupal::database(); $query = $database->select(‘member’, ‘am’); $query->leftJoin(‘person’, ‘ap’, ‘ap.member_id = am.id’); $query->fields(‘ap’, [‘id’, ‘lastname’, ‘firstname’, ’email’, ‘cellphone’, ‘iscontact’]) ->fields(‘am’, [‘id’, ‘designation’, ‘addresssupplement’, ‘street’, ‘postalcode’, ‘city’, ‘contact_id’, ‘telephone’, ‘status’]) ->condition(‘am.contact_id’, $iCurrentUserId, ‘=’) ->orderBy(‘iscontact’, ‘DESC’); $results = $query->execute()->fetchAll(); The query may […]

Categories
CMS Development Drupal

How to define default values in case of no results of a query?

I use this query on custom content entities to define default values for a form: $database = \Drupal::database(); $query = $database->select(‘member’, ‘am’); $query->leftJoin(‘person’, ‘ap’, ‘ap.member_id = am.id’); $query->fields(‘ap’, [‘id’, ‘lastname’, ‘firstname’, ’email’, ‘cellphone’, ‘iscontact’]) ->fields(‘am’, [‘id’, ‘designation’, ‘addresssupplement’, ‘street’, ‘postalcode’, ‘city’, ‘contact_id’, ‘telephone’, ‘status’]) ->condition(‘am.contact_id’, $iCurrentUserId, ‘=’) ->orderBy(‘iscontact’, ‘DESC’); $results = $query->execute()->fetchAll(); The query may […]