Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#814889
Hi,

I've written a trigger with the following content:

<?php
$query = 'UPDATE `my_table` SET `search`=\'a:2:{i:0;a:6:{s:5:"field";s:10:"APP_NUMBER";s:5:"label";s:10:"APP NUMBER";s:9:"data_type";s:4:"Text";s:8:"required";s:0:"";s:8:"operator";s:2:"EQ";s:4:"type";s:3:"AND";}i:1;a:6:{s:5:"field";s:9:"APP_TITLE";s:5:"label";s:9:"APP TITLE";s:9:"data_type";s:4:"Text";s:8:"required";s:0:"";s:8:"operator";s:2:"EQ";s:4:"type";s:3:"AND";}}\' WHERE `id`=\'1\';';
executeQuery($query);
?>

When I run it, my apache server stops!
I check executeQuery function and I found the problem is for PHPSQLParser class.

What is the problem?!
Thanks
#814906
For some reason, it can't handle the "`" (backticks). Also, don't include the ";" (semicolon) in the SQL statement.

Try it this way:
Code: Select all
$query = 'UPDATE my_table SET search=\'a:2:{i:0;a:6:{s:5:"field";s:10:"APP_NUMBER";s:5:"label";s:10:"APP NUMBER";s:9:"data_type";s:4:"Text";s:8:"required";s:0:"";s:8:"operator";s:2:"EQ";s:4:"type";s:3:"AND";}i:1;a:6:{s:5:"field";s:9:"APP_TITLE";s:5:"label";s:9:"APP TITLE";s:9:"data_type";s:4:"Text";s:8:"required";s:0:"";s:8:"operator";s:2:"EQ";s:4:"type";s:3:"AND";}}\' WHERE id=\'1\'';

Experience heightened pleasure with Cenforce 100 M[…]

Get an instant solution to move emails to MBOX for[…]

Most Demanding OST to PST Converter

The most demanding OST to PST Converter is TrijaT[…]

Betvisa clone scripts are pre-built software solut[…]