I'm running a Mambo CMS on a client site. I have setup a load of content pages, but at the moment only a few of them have content in. I need to copy the content from these pages to the others.
For example:
where Software, Training etc. are the "title" field (in the db). All of this content is stored in one table called "content".Code:Category 1 - Software - Training - Support Category 2 - Software - Training - Support Category 3 - Software - Training - Support
In total there's 4 catgories and in each 7 of those pages. Currently category has the content pages filled in. I simply need to copy the content to the other categories. I would do some UPDATE queries, but that'll take forever to do, especially as in each row, there are about 15 cells, and I only want to copy certain cells over (i.e. I need to preserve various IDs and so on).
A query I might run would be:
having copied the text from my original Software into the text='blah'. But that'd mean I'd need to do it say 10 times for each of the 7 content pages. Actually I suppose that would only be 7 queries.PHP Code:UPDATE content SET text='blah blah blah blah' WHERE title='Software'
Could I do something like:
if I found the ID of the row that holds the content of the row I want to copy over? I could stick the titles and ID into an array and just loop through it easy enough.PHP Code:UPDATE content SET text={content title id},images={content images id},..., WHERE title='Software'
I haven't played with MySQL for a while and I'm a little rusty... Muchos thanks![]()








Bookmarks