Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

SQL question


Guest

Recommended Posts

I have something I need to change in the products description on about 400 products.

 

Is it possible to tell the database to find 'xyz' and replace all occurrences with 'abc'? And what syntax would I need to put?

 

It would save me literally several hours of work if someone could help.

Link to comment
Share on other sites

ah, now if you were using a proper text edditor it would be easy! :wink:

 

if you zip them & email to me, telling me exactly what you want to change, I'll do it for you. :D

Link to comment
Share on other sites

Yes I do.

 

It was when I changed from search engine safe URLs to not.

 

All the links I had put in my descriptions no longer work - I couldn't believe it when I realised. Already had visitors go away because the button links (which I fixed first) didn't go anywhere!!

 

I did a search on Google and read on another forum that you can do a table dump, change it in a text editor, delete the original files and then reupload. But the thought of deleting 4 weeks of work scares the sh*t out of me.

 

Is there another way? I have actually done about 1/4 of them, but I would rather not have to.

Link to comment
Share on other sites

OK, I know how to do a database backup (duh ;))

 

But when I go to Export, what do I do then? It says File name template __TABLE__ Would I change that to products_description?

 

DO I need to change anything else? There are all these radio buttons that I don;t understand what they're asking me to do.

 

And how would I then delete the files.

 

I hate this stuff and I am kicking myself for making such a stupid mistake. I really thought I was finished and done.

Link to comment
Share on other sites

File name templete is just 'what format do you want the file name in?'

 

The SQL settings are probably all sellected by default, except drop tables? If you select drop tables as well, when you upload your amended file it will automatically delete the old tables & then create & populate new ones.

 

BTW Why have you turned off search engine safe urls?

Link to comment
Share on other sites

So if I tick drop tables, then I don't have to manually delete all the products before reuploading the changed ones?

 

It will do it itself?

 

And if I screw up then the backup should be OK

 

Oh it's so scary - I spent weeks on this . . .

 

Baby question - Notepad (which I usually use for basic editing of text file) doesn't have find and replace. If I open it in Word, I have heard things about Word messing up plain text files for programming purposes - adding line breaks etc. Do you know anything about that?

Link to comment
Share on other sites

Bugger. I thought it meant you used it when your site was still in development and then turned it off when you went live.

 

So I have to go and change it all back again!!

 

Bugger!!

 

Oh well, I suppose I can still do the same thing to change back the ones that I have done.

 

I have done the dump - just have to edit it now.

Link to comment
Share on other sites

OK - now I am stuck. I can't seem to work out how to save it as a text file so I can edit it. I have a load of text on the screen but when I go to "Save as" and try and save it it only saves the top line. If I select it all and try and save it, it fails.

 

Help!!

Link to comment
Share on other sites

ah, now if you were using a proper text edditor it would be easy! :wink:

 

if you zip them & email to me, telling me exactly what you want to change, I'll do it for you. :D

 

I knew there was a reason I posted that! :lol:

Link to comment
Share on other sites

Well, I thought I'd sorted it. I cut and pasted it into Word, changed it and tried to cut and paste it back into the query window but it said I had an error in my syntax. I am now uploading the backup I did before I started all thuis because it's scaring me silly messing about with it like that. But I still have to change back all the ones I had already changed.

Link to comment
Share on other sites

That's where using a decent editor comes in. A good one will highlight the syntax for you, so that its easy to spot mistakes. You can get open source text editors from sourceforge.net, so you don't even have to splash out :wink:

Link to comment
Share on other sites

But the bit it said there was an error on wasn't something I had changed. It was the stuff the stupid program had generated itself from the original database!!

 

I have wasted the whole morning doing something I didn't need to change in the first place - I am so cross!! :evil: :x

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...