Jump to content

quick UPDATE


dflow

Recommended Posts

  Quote

You are missing the quotes around your string ... and you have 1 too many quotes at the end ...

 

UPDATE `apartments` SET mainImage = CONCAT(CAST(ID-SupplierID-0 AS VARCHAR(50)),'.jpg') WHERE InternalSupplierID=7;

still quote error

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 'VARCHAR(50)),'.jpg') WHERE InternalSupplierID=7' at line 1

Link to comment
https://forums.phpfreaks.com/topic/247581-quick-update/#findComment-1271375
Share on other sites

But it is now at a different spot ... Looking at the definition for CONCAT (http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat) you can give it a number.

 

UPDATE `apartments` SET mainImage = CONCAT(ID-SupplierID-0,'.jpg') WHERE InternalSupplierID=7; 

Link to comment
https://forums.phpfreaks.com/topic/247581-quick-update/#findComment-1271378
Share on other sites

  Quote

But it is now at a different spot ... Looking at the definition for CONCAT (http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat) you can give it a number.

 

UPDATE `apartments` SET mainImage = CONCAT(ID-SupplierID-0,'.jpg') WHERE InternalSupplierID=7; 

this updated, but only ID.jpg without -0 output: 34567.jpg instead of 34567-12-0.jpg

thanks  ill read about CONCAT

Link to comment
https://forums.phpfreaks.com/topic/247581-quick-update/#findComment-1271408
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.