Questions tagged [create-function]

114 questions
0
votes
1 answer

PHP Deprecated: Function create_function()

Im getting PHP Deprecated: Function create_function() with the following code: function fetch_sentence_case($text) { return preg_replace_callback( '#(^|\.\s+|\:\s+|\!\s+|\?\s+)[a-z]#', create_function('$matches', 'return…
0
votes
1 answer

trouble shoot a creating a mySQL function for parsing a string

I'm getting a SYNTAX error attempting to create a mySQL function to parse a string. It's probably something simple that I'm not realizing given that I have more experience creating FN's with SQL then MySQL. Here's my function: CREATE FUNCTION…
0
votes
1 answer

PHP Function create_function() is deprecated , the code cant work in newest PHP?

I have a function which im not entirely sure how to convert it to get working in newest php $eventSponsor = array_map(create_function('$o', 'return $o["id"];'), $event->sponsors); which method should i use in newest php version ?
mactavich
  • 3
  • 2
0
votes
1 answer

Need help understanding create_function() and regex

After allot of searching around SO and other forums also stumbling over various php function documentation, I tried to edit a function that I found on here(converts URLs to clickable links) so it will also handle embedded video, unfortunately my…
Elgoog
  • 2,205
  • 7
  • 36
  • 48
0
votes
1 answer

SQL Server : Create Function Wrong Syntax near 'Begin'

I have a problem figuring out how to get rid of an error. It says there is wrong Syntax near the Begin statement. I assume it means before, but I do not know what. I've tried many different declarations of the function but did not get it to…
Moeren
  • 23
  • 6
0
votes
1 answer

Php clean data without create_function and without eval

I am trying to create a class to clean data for a brand before adding it to my database. As you can see I have added general filters (which can be used elsewhere). On the other hand, some fields will need a personalized cleaning. That's why I…
0
votes
0 answers

Php parses function without create_function and without eval

I am trying to create a class to clean data for a brand before adding it to my database. As you can see I have added general filters (which can be used elsewhere). On the other hand, some fields will need a personalized cleaning. That's why I…
0
votes
1 answer

Create function on mysql

I have the following on mysql: DELIMITER // CREATE FUNCTION dateDiff1(contract_id INT, cust_id INT) RETURNS INT BEGIN DECLARE startDate, endDate DATETIME; DECLARE result int; SET startDate = (SELECT startDate FROM contract WHERE insurance_cover_id =…
knstdms
  • 21
  • 3
0
votes
0 answers

MySQL: Create Function, Execute statement and Drop function

I have wrote mysql query to update column using mysql variable. Actually I'm want to create the function, execute it and then drop the function for below query. I'm really new to mysql Function, Can some please help me to covert query into mySQL…
happy
  • 17
  • 1
  • 1
  • 2
0
votes
0 answers

syntax error problem on END keyword with MySQL code

Why do I get a syntax error when everything looks fine. The error position on the MySQL workbench is indicated. I have checked alot of questions, but found no answer. I know it will be a minor problem but I can't figure it out SELECT * FROM…
Kennedy
  • 27
  • 8
0
votes
1 answer

Unterminated dollar-quoted string creating PostgreSQL function

Using PostgreSQL 12.3, I am having some trouble trying to validate this simple chunk of plpgsql code create or replace function test() returns void as $$ begin prepare plan as select 1; execute plan; end; $$ language plpgsql; Error…
coterobarros
  • 941
  • 1
  • 16
  • 25
0
votes
1 answer

Flink1.10 why does DDL not support create view and create function?

Flink1.10 why does DDL not support create view and create function ?
Ceaser
  • 1
0
votes
1 answer

How to declare a variable as a result of a function?

I am currently making a function, and I need to declare a variable as a result of an other function within my main_function. CREATE OR REPLACE FUNCTION main_function(t_name varchar) RETURNS void AS $BODY$ DECLARE var_1 varchar := execute…
0
votes
1 answer

How to create an SQL function that returns the table with an extra column, filled with values, based on a condition?

I have a "code_table" containing uinque integers (code) and unique texts (name) in pairs. I have several tables where I have the codes, but I don't have the names. I would like to create a function that returns the table I'm intented to change, but…
588chm
  • 215
  • 1
  • 8
0
votes
1 answer

Patch for create_function() causes problems in PHP 7.3.6

I am trying to replace deprecated "create_function" in a CMS. I already found a lot of answers for this topic. However, the patch I used resulted in even more trouble and I am not really firm in working on this level of PHP functions. Therefore I…
Micha
  • 15
  • 4