Is there any way to see if a post exists by a meta value? For instance, lets say I want to see if another post has a unique meta value of “pictureID”, and if so do something else. Is there a way I …
Tag: php
Memory leak when executing Doctrine query in loop
I’m having trouble in locating the cause for a memory leak in my script. I have a simple repository method which increments a ‘count’ column in my entity by X amount: Problem is, if I call this in a loop the memory usage balloons on every iteration: What am I missing here? I’ve tried -…
Magento separate PHP-FPM group for admin
I run a Magento webstore with middling traffic levels, running on NGINX with PHP-FPM. The server environment is very powerful with plenty of overhead, so hardware is not a factor. We are getting timeouts and errors when running memory intensive operations in the backend, such as exports and some custom indexe…
What is the simplest way of implementing pricing plans in mysql and php?
I am working on a project, and I am trying to find a way to associate my pricing plans table with a customer. id name description price days 1 Free the free plan 0.00 0 2 Silver …
Cast a column as Boolean in PDO
I have a field (‘done’) in the Database which is boolean. The function which GET/ the rows doesn’t return a json with that field as boolean but it returns 1 or 0. How can I get THAT column (‘done’ column) as boolean? I mean, Is posible to cast a column with PDO::PARAM_BOOL ?? Her…
Laravel Mail::send() sending to multiple to or bcc addresses
I can’t seem to successfully send to multiple addresses when using Laravel’s Mail::send() callback, the code does however work when I only specify one recipient. I’ve tried chaining: and passing an array: but neither seem to work and I get failure messages when returning Mail::failures(), a …
Title tag showing latest post title
I am working a site here . the title tag of the site in tab shows the title of the latest published post . the header.php has the following i replaced it to still its showing. i have installed All In One SEO Pack plugin.is that could be the reason.If yes,is there any way to correct it without deactivating the
How to tell phpDoc a string is a class name?
I often give objects static methods and properties that do not require the object to be initialized. For example: Now we subclass these objects and have some sort of controller that returns an object class string under certain circumstances where the object should not yet be initialized. For example: At times…
The meaning of a mysql query
I’m working with hierarchical data in my cms. My menu table is this: id || name || lft || rgt And my left and right columns are: To retrieving a full tree and it’s depth, I’ve found this query: …
How can I parse command line arguments in PHP?
I call a PHP script from command line $ php my_script.php –num1=124 –first_name=don How can I get access to any key value pairs passed into this script? The keys can be arbitrary, so using getopt() with particular values will not work. Here is what I want access to in my script: If I use var_dump(…