Need a MySQL query to delete duplicate comments - comments

My wordpress site was recently hacked so I had to reinstall everything. Wordpress resinstalled, database backups imported, everything fine and dandy. Then I installed the Disqus plugin and synced (Disqus was previously used before the site was hacked). Big no-no apparantly. Now I have a duplicate of every single comment on my site! Even worse, the duplicate comments have been synced BACK to Disqus!
So, I know this is a simple query in PHPMyAdmin but I don't know it! Please help!

D'oh, I just posted this as someone migrated it to SO...! Fortunately I have an account here too :)
FOR THE LOVE OF GOD BACK YOUR DATABASE UP FIRST
I haven't tried this query as I don't have a spare database to play around with.
This should help you though:
table1 = your table name
field_name = a field in your database.
DELETE FROM table1
USING table1, table1 as vtable
WHERE (NOT table1.ID=vtable.ID)
AND (table1.field_name=vtable.field_name)
As it's WordPress comments, presuming a prefix of wp, I'd probably recommend....
DELETE FROM wp_comments
USING wp_comments, wp_comments as vtable
WHERE (NOT wp_comments.ID=vtable.ID)
AND (wp_comments.comment_content=vtable.comment_content)
Hope that helps. Please read the note in bold before even contemplating running this query.

Related

Magento downloadable product link empty

we have a problem with our magento shop before going live. We do not exaclty know when did this one happen. We want to offer digital goods (pictures) as download links from external host.
Everything worked fine - we did not test the checkout for a month.
Now we have a problem, if customer buys a digital good, his download link for his picture does not work. It is empty. The hashkey in the DB seems ok. In Backend the purchase is being triggered. We suppose the connection between the hashkey and the external url is wrong.
We did 2 things since that but already applied a rollback. We installed SSL sertificate and a delete old orders extension. Can one of these things cause our problem?
Thank you a lot for any hint.
Best regards
Dimitri Petrik

Virtuemart Database

I am working on an android application to make some website available on mobile to browse.
The thing is Virtuemart tables are too many to read and i need this to be quick and quite east so i can take a JSON object to from the db.
what i need in specific is to read the categories, then each category products with details images etc...
i tried to read the tables and make select statements but still cant find what i need.
I can code the PHP and the SQL statements but the tables are too much i would appreciate any help.
thanks in advance.

How to make all Joomla users to be registered

I have moved all users from joomla 2.5.6 to version 3.3.6 via phpmyadmin
every thing is works fine,but the field user groups was empty, just I need to make all users registered.
Kindly check the screenshot.
http://www.creativelinkstudio.com/1.jpg
I find a solution, via phpmyadmin
insert into _user_usergroup_map (user_id,group_id) select id,2 from _users;
Thank you
That's a legacy field from 1.5 and is a red herring, except it indicates that perhaps you had previously had a migration with some unnoticed problems. In 1.6 + users can be in multiple groups and so what matters is the mapping table, as in the linked answer from #lodder. If everything is working fine you probably already have good data in the mapping table.

Is it advisible to add new table in Joomla?

I need to know if it is advisible to add new table in default database of Joomla. Will it be preserved if I update my Joomla.
If yes, then can anybody describe the steps?
Yes, you can add custom database tables if you wish, it doesn't pose any threats. Just make sure you use Joomla coding standards when getting or adding data from the table. More information on that can be found here:
http://docs.joomla.org/J2.5:Accessing_the_database_using_JDatabase
As for updating Joomla, yes, the table will be preserved.
Hope this helps
As already said, you can add any table you like to your Joomla database. Joomla doesn't care for tables it doesn't know. And those extra tables are not modified by an update.
BUT keep two things in mind:
1. If you make backups of your database with a joomla extension (such as lazyBackup) and you want to backup your extra-tables too, then make sure to include these extra tables by choosing the appropriate options in the backup extension. By default those extra table might not be included in your backup.
2. As you can easily see in phpMyAdmin all joomla tables start with a prefix such as he3ie_. This prefix is different on every joomla installation (if you did not choose your own). It is no good idea to start your extra tables with this prefix. This might collide with joomla-tables which could be created in the future (by joomla or by an extension).
as everybody said adding tables will not be affected by Joomla upgrades unless they decide to name a new table the same as yours. A table "name" could also clash with another extension that you want to install so it would be good advise to spend some time thinking on a name that will make sure is unique to your use or component.
Of course if this is a one-off custom thing then it matters less.
If you are looking for a more in-depth tutorial try this YouTube Video: http://www.youtube.com/watch?v=twT3q7dyVpI
Joomla update doesn't disturb your custom database tables or any other data. Just create the database as you want like phpmyadmin etc & use it without any fear.

need to save all the records at once to get url identifier in magento. Any efficient way or script available?

I have started work in magento last week, i have never worked before in magento. Recently i imported more than 8,000 records in it using csv file. Now i can see all that records in magento admin panel so it's done successfully.
Problem: But it is not displaying at frontend.
I found problem in url identifiers, to solve this problem i need to go in each record category and save it then url identifier showing and also displaying in frontend. So i have to do it for each record.
I think it will take more time and also i have to add 31,000 records more.
Do you have any suggestion to do it quickly? any efficient way available for me? can i use any script to save all record at once?
This question may have duplicate but it will pleasure if you give answer or suggestion to me.
Thank you.
Why don't you just re-index all your indexes ?

Resources