118 questions
0
votes
1
answer
89
views
How to code a conditional call of create function in SQL Server [duplicate]
I am writing a script, that updates the database of my application to the next version.
As part of the latest version updgrade, i added a regex function as a CLR User Defined Function out of an ...
0
votes
1
answer
67
views
Replacing create_function in validation loop
I have a validation loop in a class in an outdated but functional plugin that I need to keep (for now). It uses create_function twice.
if( is_array($s) ) {
$c = count($s);
...
0
votes
1
answer
1k
views
PHP Parse error: syntax error, unexpected token "{", expecting ";" while trying to replace create_function() [duplicate]
Could someone please help me check the syntax in the following code and why this is giving an error?
I've tried updating one of my Wordpress files to use the new syntax for function:
{
$if = ...
0
votes
0
answers
192
views
Creating a function that changes the data types of columns in PostgreSQL
UPDATED
I've written the following function and it is created successfully. But when I go to call it, an error pops up. I'm just learning how to use functions in Postgres, and I am confused here.
...
-1
votes
1
answer
85
views
Create_function deprecated [duplicate]
I have taken over the 'admin' of a Wordpress website without the benefit of any documentation and it is falling over when creating invoices with this error. Whilst I can do somethings to get it going, ...
0
votes
0
answers
24
views
write a function to produce a plot in R [duplicate]
I am trying to write a function that builds a plot, but as a return I get an empty plot. Can you advice what can I be doing so wrong? Clearly something is wrong with aes portion, but cannot figure out ...
4
votes
2
answers
2k
views
How to read the function body of a Postgres standard-SQL function?
In Postgres 14 a new kind of syntax was added to CREATE FUNCTION where the body of the function can be specified directly in SQL rather than being contained in a string. The string bodies of functions ...
-7
votes
2
answers
86
views
Can someone help me resolve an sql syntax error on pgadmin while creating a function? [closed]
First Attempt -
CREATE FUNCTION rental_quarter (rental_date TIMESTAMP)
RETURNS VARCHAR(7)
BEGIN
IF MONTH(rental_date) BETWEEN 1 AND 3 THEN RETURN YEAR(rental_date)+ ”Q1”;
ELSE IF MONTH(rental_date) ...
0
votes
1
answer
28
views
Using Formoid webform on this page www.franktribute.com/RequestForm/request-form.php and now there is a depreciated error message on the page
The form has recently stopped sending.
Deprecated: Function create_function() is deprecated in /home/customer/www/franktribute.com/public_html/RequestForm/testform4_files/formoid1/handler.php on line ...
1
vote
2
answers
397
views
Replace create_function with empty $args for PHP 8
I'm having trouble rewriting this line of code that contains create_function() in preparation for updating to PHP 8+.
The line of code to replace is:
add_action('widgets_init', create_function('', '...
1
vote
3
answers
280
views
creating function, outside main() function, for random Number in specific range
I am trying to write a function for a random number in a range decided by the user. I call srand() in int main() with the function RandomNumber defined above.
I know if do the randomnumber equation in ...
-1
votes
3
answers
1k
views
How can I create a function to find the average of a list?
I'm trying to create a functional for the average of a list that accepts three parameters: a mandatory list of numbers, an optional minimum value which defaults to zero, and an an optional maximum ...
0
votes
1
answer
2k
views
rpc function tell me to reload the schema cache
I am creating an rpc function to get the number of likes for each post for a user, so I have created a function that takes userId as an argument, which is the uuid of the user that is in the session. ...
0
votes
1
answer
111
views
How to insert an array of ids with create function in node
I Have defined this mongoose schema in node
`const bookingSchema = new mongoose.Schema({
tour: [
{
type: mongoose.Schema.ObjectId,
ref: 'Tour',
required: [true, 'Booking must ...
1
vote
1
answer
344
views
Migrate create_function() which is not supported since PHP 7.2
I have 'create_function() in my PHP code:
function encode_code_in_comment( $source ) { $encoded = preg_replace_callback( '/\[(php|html|javascript|css|nginx|apache|terminal)\](.*?)\[\/\1\]/ims',
...