Category "php"

Yii2 select2 database exception number of bound variables does not match number of tokens

when i use select2 widget in my yii 2 applicaton, it will cause the following error: SQLSTATE [HY093]: Invalid parameter number: number of bound variables does

Yii2 select2 database exception number of bound variables does not match number of tokens

when i use select2 widget in my yii 2 applicaton, it will cause the following error: SQLSTATE [HY093]: Invalid parameter number: number of bound variables does

How can I update time by condition?

Hi everyone please i need you're help. What i want is when the input field is updated with this value: Résolu --> update column date with date now. I

JSON Render Issue in Date Object Laravel and PHP 7.4

I am facing a stranger issue in php 7.4 inside Laravel. When I am trying to log the results using dd() function for any collection its gives me that my date fie

How to Subscription details from the wcs_get_subscriptions_for_order() function

I have this variable: $subscriptions = wcs_get_subscriptions_for_order($order_id, array('order_type' => 'parent')); Using this print_r() I can see lots of d

Laravel insert dynamic input values with radio button

I am a beginner at Laravel, I want to insert a more dynamic address field to the database and I want to select one primary address using the radio button. I can

Login if user is active using Laravel Breeze

I've changed it in the LoginRequest.php file at authenticate function, but it doesn't work. if (! Auth::attempt($this->only('email', 'password', ['active' =&

I cannot create a auto generated date time in mysql workbench

I'm trying to create an auto-generated date-time using MySQL workbench, timestamp seems not working This is the error Operation failed: There was an error whil

Display the WooCommerce product price inside a custom function

I have created a custom function to display 3 custom fields (ACF) and the product price in the WooCommerce Archive/Shop page. My Custom fields are showing corre

Getting failed loading params from .env vlucas/phpdotenv library required, but library is in

When I try to run my PHP Codeception test environment through Docker in my project, I get the following error: docker-compose run --rm codecept run ui_aut

PHP cURL (SSL certificate problem: self signed certificate in certificate chain)

When making a php cURL request in production, I am getting the following error: Problem with SSL certificate: self-signed certificate in the certificate chain.

How to get an Array value inside an object in an array Php [duplicate]

I have this array below at the last code part. To get ["db"] and ["size"] object in array through a loop I use <?php foreach ($result->

Display a success custom notice after Placing an Order in WooCommerce

I need to check on the checkout page whether payment has been successful or not and display the message: 'Your payment has been successful', and then redirect t

Laravel 8 http testing error Failed asserting that two strings are equal

I want to test the endpoint Sign Up (you can consider signup as registration), and at the same time I want to return the response object and redirect the user t

Separate SQL commands in PHP

I have a (dynamically generated) file that includes a lot of SQL Statements that contain only data definition. Usually, I run the whole script as a single trans

get data-value with variable value

I have a data-value in my php code that is used in several places, for example: <a class="dropdown-item" data-value="<?= $i ?>"></a> <a cla

How to Create WooCommerce Subscription Product via. REST API?

I am able to find the REST API docs for WooCommerce: https://woocommerce.github.io/woocommerce-rest-api-docs/#create-a-product but am unable to figure out how t

Use environment variables in Laravel Nova

I am trying to follow: https://laravel.com/docs/9.x/mix#environment-variables My project setup is Laravel Framework 8.4 Php 7.4 Laravel Nova 3.0 .vue file in /n

Sagepay Error The Vendor failed to provide a RedirectionURL

Integrating the Sagepay payment in PHP. I am getting logs in notification URL and getting response data including transaction details. From there passing the re

How to render html from a @foreach loop in a textarea

Using Laravel 8 livewire, I need to render a list of name ($list) on per line in a textarea. I do this <div class=" border border-red-800 rounded-lg mt-8 p-4