Skip to content
Advertisement

Tag: php

How can I update json column with a correct data type with PDO?

I have MySQL 5.7 and a query with PDO: But after it I’m having: id data 1 {“old_field”: 2, “new_field”: “1”} Why does my new value have a string type? Expected table: id data 1 {“old_field”: 2, “new_field”: 1} I have success without using PDO(JSON_OBJECT(‘new_field’, 1)), but I have a string type with using placeholders. Answer When you pass an

laravel – unable to get data outside foreach

dump($data) outside the foreach loop gives me only 1 data where as dump($data) inside the foreach shows all arrays of rows of data . How can i get all rows of data outside the foreach too? EDIT: Error: Call to a member function paginate() on array Answer In Controller add new function for it After that crate that function for

Checkbox HTML array syntax doesn’t work in CakePHP 4

I have an application in CakePHP 4 where I’m doing the equivalent of what’s described in Make array from checkbox form The markup I have is simple: So somebody could for example check “Service 1” and “Service 3” and omit “Service 2”, e.g. I’ve used the Form Helper in CakePHP to generate the HTML above. The code looks like this

Retrieving PayPal email address after payment?

When you are setting up a PayPal Buy Now Button, you can take customers to the URL when they finish checkout. Is there a way to retrieve their PayPal email immediately after PayPal checkout using $_GET? Does PayPal append some kind of ?email=email@address.com at the end of your thankyou page? Or is there any variable I could add at the

Laravel :value in another language

Laravel 8 php 7.1 I have a form with some input fields. The form is available in English and German. If you don’t enter something in the German version and want to send it, the following text appears: (In English that means This field is required if the job description is not available. ) How can I replace the job

Advertisement