I accidentally added the following line to my SQL database twice:

INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_birthdays_ahead', '7');

How do I remove one of them?

use delete query

Delete from phpbb_config where config_name = 'allow_birthdays_ahead' it will delete that two data..

And insert it again..

it will delete duplicate

delete data
from table_name
where count(data)>1;

Member Avatar for ZootAllures

use delete query

Delete from phpbb_config where config_name = 'allow_birthdays_ahead' it will delete that two data..

And insert it again..

Rather than delete both and then reinsert, just add LIMIT 1 to the end of the delete, and it'll only delete one of them.

Rather than delete both and then reinsert, just add LIMIT 1 to the end of the delete, and it'll only delete one of them.

yes.....as you said select data using limit 1,and then dalete. it's simple

So use the following?

Delete from phpbb_config where config_name = 'allow_birthdays_ahead' LIMIT 1
Member Avatar for ZootAllures

So use the following?

Delete from phpbb_config where config_name = 'allow_birthdays_ahead' LIMIT 1

Exactly!:)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.