Questions tagged [create-function]
114 questions
1
vote
0 answers
Refactor create_function() to an anonymous function using RectorPHP
For php 7.2 compatibility, I need to refactor the following create_function() to an anonymous function:
function bbpp_thankmelater_shortcode_h($atts, $content = NULL) {
extract(Bbpp_ThankMeLater_Shortcoder::atts(array(
"email_type" =>…

Evos
- 11
- 3
1
vote
0 answers
cashier/stripe subscription not adding complete data in DB
I'm trying to create a subscription with cashier. it was working fine yesterday but now there's a problem and i don't know what changed. the problem is subscription is being created on stripe and correct data is returned but not all data is added in…

Tallal
- 21
- 4
1
vote
1 answer
Function create_function() is deprecated on WP-Filebase
So I have a client that purchased a plugin for her website and the plugin is showing errors on the main website.
Deprecated: Function create_function() is deprecated in /var/www/wp-content/plugins/wp-filebase-pro/wp-filebase.php on line…

Nikimaria87
- 78
- 10
1
vote
1 answer
How to fix deprecated create_function
We have recently updated our Wordpress to work with PHP 7.2. After having a few issues I have turned on the debug to see that most of the issue is deprecated code.
I am not a coder but I have look through the forums and found a couple of answers.…

monasita
- 11
- 1
1
vote
1 answer
CREATE FUNCTION works on local, fails on server - same version of MySQL
I've got a weird one: I've got MySQL v5.7.24 on my local machine, and my server. The following code executes fine locally:
DROP FUNCTION IF EXISTS SharingRatio;
CREATE FUNCTION SharingRatio(users int, sharer int, cabins int, outdoors int) RETURNS…

Anthony
- 487
- 1
- 6
- 21
1
vote
1 answer
Actionscript equivalent to PHP's create_function()
I was wondering if actionscript had something equivalent to PHP's create_function. Specifically, the ability to create a function from a string is what I am looking for.

Fragsworth
- 33,919
- 27
- 84
- 97
1
vote
1 answer
How to compile a user defined function in SQLite
I have an example C function that I would like to attach to a database temp.sqlite (it's from an O'Reilly book, so I know it works). I read the section in the book and sqlite.org, but they assume away that I know how and where to compile this thing…

Richard Herron
- 9,760
- 12
- 69
- 116
1
vote
3 answers
MySQL: Create function with select statement + calculation
I need your help. I should create a function which calculates the prescription costs of a prescription. The formula should be like this:
price of medicine x dosage x ceiling(duartion/24h)
The signature of function is:
prescription costs(mname…

user2379123
- 85
- 3
- 14
1
vote
1 answer
MySQL Create function statement with existing table
I have asked these question before but I think it is better to ask a new question because my old question appears to be slightly different. I didn't mention the existing table and the input there.
I have a table 'item' which contains all the data…

user2379123
- 85
- 3
- 14
1
vote
1 answer
MySQL CREATE FUNCTION fails on a shared webserver
I have the following function. When I try to create it on a webserver, it fails with
You do not have the SUPER privilege and binary logging is enabled (you might want to use the less safe log_bin_trust_function_creators variable)
I never had the…

cypher
- 6,822
- 4
- 31
- 48
1
vote
0 answers
DB2 SQL: Join Table Function with Recursive CTE on More Than One Row (Split Strings)
On IBM DB2 V10 I have created following function. This function contains a recursive common table expression. It splits a text string, for example 'abc,def,ghi', into a table with three rows 'abc','def' and 'ghi'.
CREATE FUNCTION TOOLS.SPLIT (
…

conspicillatus
- 195
- 3
- 11
1
vote
1 answer
How to redeclare/redefine MySQL User Function every time you refresh?
Is it possible to redeclare a MySQL function every time you refresh, this is my code
mysql_query("
DROP FUNCTION IF EXISTS Add_num;
CREATE FUNCTION Add_num(LAT_A INT)
RETURNS INT
READS SQL DATA
DETERMINISTIC
BEGIN
DECLARE Ans BIGINT;
SET Ans = LAT_A…

user3741635
- 852
- 6
- 16
1
vote
0 answers
Pushing array variable from inside array variable which has been created dynamically funtion
I would like to have this array from
array(
'label'=> 'Guest Capacity',
'desc' => 'Total capacity of Guests',
'id' => 'vessel_guest_capacity',
'type' => 'select',
'options' => array (
1 => array ( 'label' => '1', 'value' => 1 ),
2 =>…

Deniz Porsuk
- 492
- 1
- 6
- 20
1
vote
2 answers
Multiple String Search and Replace on SQL Server (for templates)
I have a database table that has template html, formatted as "text {var1} text {othervar}".
I would like to apply the string substitutions in a more pragmatic way than:
set @template = replace(@template, '{var1}', field.value);
set @template =…

Marques Johansson
- 81
- 1
- 8
1
vote
3 answers
PHP, create_function or evaluate it at runtime?
I have a class with some method that depend by one parameter.
What is the best way to write this method?
Example:
First way
class Test{
var $code;
function Test($type){
if($type=="A"){
$this->code=create_function(/*some…

blow
- 12,811
- 24
- 75
- 112