Answer the question
In order to leave comments, you need to log in
Why is the data in the database not being edited?
Hello! I just can’t understand why I don’t edit the data in the table through phpmy admin,
here is the table itself
CREATE TABLE IF NOT EXISTS `grey_csgo_gifts_list` (
`id` int(11) NOT NULL,
`username` varchar(32) NOT NULL,
`bd_model` varchar(50) NOT NULL,
`wep_id` int(11) NOT NULL DEFAULT '0',
`title` varchar(100) NOT NULL
) ENGINE=MyISAM AUTO_INCREMENT=30 DEFAULT CHARSET=utf8;
Answer the question
In order to leave comments, you need to log in
UPDATE `grey_csgo_gifts_list` SET `username` = 'pillar-03-edit' WHERE `grey_csgo_gifts_list`.`id` = 0; but each row must have a unique id (id = 1, id = 2, and so on) on which you will select. In order not to have problems with the architecture, create a primary key and a unique identifier.
the primary key, which should be id , is not specified as the primary key, it is 0 in all rows - why!?
it is necessary to make the id field the primary key, but first it is necessary either to delete all rows, or to register id incrementally in each row.
however, all the lines you have are identical and there is no way to distinguish them ...
so you can do this:
set @i = 0;
update `grey_csgo_gifts_list`
set id = @i := @i + 1;
alter table `grey_csgo_gifts_list` modify `id` int(11) auto_increment primary key;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question