Jump to content

MYSQL query command


Guest OTD

Recommended Posts

Hello Folks,

Trying to edit my cc database in phpmyadmin, and i wish to do a sql update query but im not having any joy, any help in this would be greatly appreciated.

basically i wish to write a query that in cubecart_category it copies one column to another column while adding some extra words, the query im currently using is -

"update CubeCart_category set cat_metakeywords = `cat_name` & 'word1, word2, word3, word4'

but this isnt doing anything..... :angry:

PLEASE ANY IDEAS IN THIS WOULD BE BRILLIANT AND MUCH APPRECIATE BEFORE I PULL ALL MY HAIR OUT!!!!! (NOT MUCH LEFT AS IT IS!!!!!)

Link to comment
Share on other sites

MySQL supports neither '||' nor '+' for concatenating strings. Perhaps only Visual Basic supports '&' for concatenation. MySQL supports an unlimited number of arguments to CONCAT().

I would try:

"update CubeCart_category set cat_metakeywords = CONCAT('cat_name', 'word1', 'word2', 'word3', 'word4')"

Link to comment
Share on other sites

bsmither thank you very much on this, im not currently at work, but i will try this first thing in the morning and i will let you know the outcome, thank you very much for your reply.

Link to comment
Share on other sites

bsmither as before thank you for your reply, i had to changer the command a little to;

update CubeCart_category set cat_metakeywords = CONCAT(`cat_name`, ', word1', ', word2', ', word3', ', word4')

but that worked perfect thank you!!!!!!!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...