January 12th, 2013, 04:34 PM
In phpMyAdmin, I wrote unsuccessfully:
UPDATE `_files` SET `img_path` = "./Photos/" + `img_name`;
which means: I want to fill in table _files all the rows of the column img_path with the string "./Photos/" plus the whole content of the corresponding row in column img_name
Example: if a row in column img_name contains "blah blah.jpg", I want the corresponding row in column img_path to contain "./Photos/blah blah.jpg" (even if "blah blah.jpg" contains a space!)
The above query set all rows in img_path to 0 (zero not o) except some which contains a part of the content of img_name...
img_path and img_name are varchar(100), utf8_general_ci, no Attributes, NULL=No, no Extra
Many thanks in advance for your help!
January 12th, 2013, 05:08 PM
there is no "+" concatenation operator in MySQL. You need to use CONCAT.
Apart from that, saving the same directory for every image is obviously redundant and makes no sense. It can lead to conflicting data, and you have to change every single row whenever you change the file path.
Instead, put the directory name into a separate "file_paths" or "configuration" table. Or simply hard code it in your application.
January 12th, 2013, 05:58 PM
Thanks for your reply!
Silly of me! Of course, the "+" sign has nothng to do here!
I thought I still was in Action Scripting in Flash...
Last edited by Germaris; January 12th, 2013 at 06:12 PM.