Closed herbie4 closed 4 years ago
Do you have an error output to start with? Have you already tried some solutions?
Do you have an error output to start with? Have you already tried some solutions?
Yes tried the query directly in the commandline and then it works. The problem is that I need to use '_transient_fusion_fontawesome_en' with quotes for the query to work, but in the hook I cannot use ' ' these quotes again. If they are in the hook as shown before I get this error:
local | Output: ERROR 1054 (42S22) at line 1: Unknown column '_transient_fusion_fontawesome_en' in 'where clause'
Isn't simply
'mysql --host=localhost --user=wp --password=wp --database=myDB --execute="DELETE FROM wp_options WHERE wp_options.option_name=\'_transient_fusion_fontawesome_en\'"'
a solution someway?
Isn't simply
'mysql --host=localhost --user=wp --password=wp --database=myDB --execute="DELETE FROM wp_options WHERE wp_options.option_name=\'_transient_fusion_fontawesome_en\'"'
a solution someway?
Nope. Tried that as first option. Error:
(<unknown>): did not find expected '-' indicator while parsing a block collection at line 57 column 11 (Psych::SyntaxError)
@pioneerskies SOLVED!
Thank you for putting me on the right path. The sollution is actualy simple.
I just needed to use 2 single quotes in front and in the back and it works.
So -> ''_transient_fusion_fontawesome_en''
Inception escaping black magic (as in the majority of software that uses such configurations!). Good catch. But when the scenario get worst than this i think it's necessary to add a bash script in the project and invoke it through the hook. That's really the most solid solution.
Cheers
Hi all, Trying to run a mysql query in a hook but need to escape quotes in the where clause on the option_name to make it work. Any ideas...?
- 'mysql --host=localhost --user=wp --password=wp --database=myDB --execute="DELETE FROM wp_options WHERE wp_options.option_name='_transient_fusion_fontawesome_en'"'