Unix & Linux Asked by Ian Arman on December 2, 2020
I’m executing the following command on my server to add a new entry into the db:
mysql --useruser --password='password' --database='mydatabase' --execute='INSERT INTO `artist` (`artist_id`, `artist_name`, `name_sorted`, `Discogs_Real_Name`, `Discogs_Search_Name`, `url`, `current_rank`, `previous_rank`, `last_rank_change_date`, `Discogs_ID`, `Discogs_IMG_URL`, `discogs_file_jpg`, `discogs_file_png`, `discogs_file_icon`, `Discogs_Profile`, `musical_id`, `artist_id_new`, `artist_id_feat`) VALUES ('"'$artist_id'"', '"'$discogs_name'"', '"'$discogs_name'"', '"'$discogs_name'"', '"'$discogs_search_name'"', '', '0', '0', '2020-08-28', '"'$discogs_id'"', '"'$discogs_image_url'"', '"'$discogs_new_filename_jpg'"', '', '', '', '"'$musical_id'"', '1', '')';
after running the command I receive the following error message:
ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' 0, 0, 2020-08-28, '17546', ' https://img.discogs.com/jWSXBLWwmOog3YRLDtGQ_RK95x' at line 1
You can't have single quotes within single quotes without escaping them. Within single quotes, variables - eg $musical_id - won't be interpreted.
Answered by Gerard H. Pille on December 2, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP