skip to Main Content

Bash command mysql : escape single quote from variable

This command echo "mysql -u root nextcloud -Bse 'DELETE FROM oc_filecache WHERE path=""${FILE_PATH}"";'" will show that mysql -u root nextcloud -Bse 'DELETE FROM oc_filecache WHERE path="files_encryption/keys/files/xxx/xxxx/xxx L'AME/2xxxx/OC_DEFAULT_MODULE/master_x626.shareKey";' There is a single quote in the path. When i execute command, this…

VIEW QUESTION

Exclude two last week mysql

Good morning, I am on a MySQL database and I have the following query which extracts data from the last 6 months to today's date : select distinct date_format(abc.date,'%d/%m/%Y') as date_bes from table abc where abc.date BETWEEN CURDATE() - INTERVAL…

VIEW QUESTION

PHP, how to format DateTimeInterface for mysql?

When I write a php DateTimeInterface to mysql timestamp field, I always do: $datetime = (new DateTime())->format('Y-m-d H:i:s'); $sql = "... when_inserted = '$datetime'"; I know that DateTimeInterface::format supports Full Date/Time formatting (c, r), but both of them produce a…

VIEW QUESTION
Back To Top
Search