Category "php"

Must be of the type array, null given,

I keep getting the following error and I'm not to sure why: Catchable fatal error: Argument 3 passed to System\Loader::action() must be of the type array, nul

Can't remotely connect to MySQL error (13) with PHP script, connecting through CLI works

I have looked at around 50 of the same question on here, but none of them seem to be fixing my problem. I can't remotely connect to my MySQL database through a

wordpress function breaks wp-admin

I've created a function in my custom WooCommerce site. This works great on the frontend, but wp-admin breaks. Wp-admin shows a http-500 error. This is the funct

How to display old value in dropdown on edit form then keep the selected value when the form submit failed?

The dropdown's option values were shown from a table on the database. When I clicked "Edit Form," the old values were successfully shown. For example, the optio

Bulk import products into Woocommerce using WP WC CLI

I'm trying to add 1000's of products into my woocommerce store using wp wc cli via my datasource which will give me the data in the following JSON format: {

How can I format this number correctly using PHP?

I have a number with numbers after the decimal but for some reason when formatting it, the last two decimals are always zero. For example a price is 154,95 as

flutter multiple postwith php api problem

I am sending multiple user_id with form data in a flutter to PHP page but my PHP API did not see array or obj. I used this code for other projects it could work

Google Analytics, display real time php

I have queries working nicely, but how do I include real-time data? This is my current code: <?php // Load the Google API PHP Client Library. require

wordpress image url wrong in database

We have a wordpress website that was migrated over a few months ago and some images are displaying the wrong link still. For example, one image on a gallery has

Manage independently the decimal number of the price of each product [duplicate]

I develop an online store with woocommerce and I would like to display the price of the product with 3 decimals when the price contains 3 (exa

Why config cache not working on my shared hosting in Laravel 8

I uploaded my laravel site in shared hosting, my site is working well in localhost, but the CSS is not working on the server. I want to clear cache but not run

Store / Website Column in Magento 2 Admin Grid - Custom Module

I have created a custom module in magento 2. I have two tables, first one is the main table and the other one is for the stores. The second table has the foreig

PHPExcel file download using AJAX call

I have a PHPExcel code which I use to export file, It works completely fine when i run it through normal static inputs but when tried with ajax calls the file i

Lexik JWT authentication problem "Invalid credentials"

I am new to symfony and I am using LexikJWTAuthenticationBundle for authorization. I am using symfony 6.0.2 and 2.14 lexic version. I am using Postgresql 12.9.

Codeigniter changes with `count_all_results`

So... it appears as if overnight, SOME-thing has changed with either the Codeigniter 4 framework or PHP in general, as my website is now down - and it seems to

PHPExcel file download using AJAX call

I have a PHPExcel code which I use to export file, It works completely fine when i run it through normal static inputs but when tried with ajax calls the file i

Unable to read the "../.dev.env" environment file in Dotenv.php:symfony

I want To run a symfony project in my computer but I get all times errors , and now I get this error and i didn't find any solution for my problem Problem Fail

How to make dot match newline characters using regular expressions

I have a string that contains normal characters, white charsets and newline characters between <div> and </div>. This regular expression doesn't wor

SQL AVG() to 2 decimals

I'm trying to get this average to give me 2 decimals, so instead of 17.4534 I just get 17.45. I tried various combinations using CAST in each of the 2 places I

Laravel 5: Is there a non-case sensitive way to sort a collection by an attribute?

I'm struggling to sort an Eloquent collection using the sortBy() method. The issue is that the sorting is case sensitive and it first retrieves the uppercase re