1
karuna
add a lot of avatars.
  • 2004/4/8 8:36

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


Hi

i have import a lot of avatars via phpmyadmin like these.

but later i find that a lot of avatars disapeared.

i thought it maybe caused by someone changed a avatar then the old avatar was deleted.

Is the any way to avoid these happens? or is there anything wrong with the sql file?

Thanks

INSERT INTO `bnb_avatarVALUES (0'bnbface/bnb100.gif''BnB100''image/gif'107976414710'S');
INSERT INTO `bnb_avatarVALUES (1'bnbface/bnb101.gif''BnB101''image/gif'107976414710'S');
INSERT INTO `bnb_avatarVALUES (2'bnbface/bnb102.gif''BnB102''image/gif'107976414710'S');
INSERT INTO `bnb_avatarVALUES (3'bnbface/bnb103.gif''BnB103''image/gif'107976414710'S');
INSERT INTO `bnb_avatarVALUES (4'bnbface/bnb104.gif''BnB104''image/gif'107976414710'S');
INSERT INTO `bnb_avatarVALUES (5'bnbface/bnb105.gif''BnB105''image/gif'107976414710'S');
INSERT INTO `bnb_avatarVALUES (6'bnbface/bnb106.gif''BnB106''image/gif'107976414710'S');
.
.
.


2
riaanvdb
Re: add a lot of avatars.
  • 2004/4/8 11:13

  • riaanvdb

  • Not too shy to talk

  • Posts: 114

  • Since: 2004/1/29


Hi there, if you look closely to your sql code you will see that you are overwriting the avatar_id that is an auto_increment field, every time you run a new file in the format above you will overwrite the information in the table at worst or be given a reffirrential integrity error at best.

#
# Table structure for table `avatar`
#

CREATE TABLE avatar (
avatar_id mediumint(8) unsigned NOT NULL auto_increment,
avatar_file varchar(30) NOT NULL default '',
avatar_name varchar(100) NOT NULL default '',
avatar_mimetype varchar(30) NOT NULL default '',
avatar_created int(10) NOT NULL default '0',
avatar_display tinyint(1) unsigned NOT NULL default '0',
avatar_weight smallint(5) unsigned NOT NULL default '0',
avatar_type char(1) NOT NULL default '',
PRIMARY KEY (avatar_id),
KEY avatar_type (avatar_type,avatar_display)
) TYPE=MyISAM;

Always try to use sql that specifies the collumn to insert to like:
INSERT INTO `xoops_avatar` (`avatar_file`, `avatar_name`, `avatar_mimetype`, `avatar_display`, `avatar_type`) VALUES ('Animaniacs001.gif', 'Animaniacs001.gif', 'image/gif', 1, 'S');
INSERT INTO `xoops_avatar` (`avatar_file`, `avatar_name`, `avatar_mimetype`, `avatar_display`, `avatar_type`) VALUES ('Animaniacs002.gif', 'Animaniacs002.gif', 'image/gif', 1, 'S');
INSERT INTO `xoops_avatar` (`avatar_file`, `avatar_name`, `avatar_mimetype`, `avatar_display`, `avatar_type`) VALUES ('Animaniacs003.gif', 'Animaniacs003.gif', 'image/gif', 1, 'S');
INSERT INTO `xoops_avatar` (`avatar_file`, `avatar_name`, `avatar_mimetype`, `avatar_display`, `avatar_type`) VALUES ('Animaniacs004.gif', 'Animaniacs004.gif', 'image/gif', 1, 'S');


Grotmis
Riaan
http://www.craftsonline.co.za

3
karuna
Re: add a lot of avatars.
  • 2004/4/8 12:10

  • karuna

  • Not too shy to talk

  • Posts: 171

  • Since: 2002/5/29


Hi

Thanks

I have delete these avatar_id i want to add.

The things real troubles me is that some avatar will get lost after some days. So i thought it is because that these lost avatar was once used by someone else. but then these avatar was deleted as when changing a avatar says"Your old avatar will be deleted!"

But as a system avatar it shouldn't be deleted??

4
Anonymous
Re: add a lot of avatars.
  • 2004/5/19 0:36

  • Anonymous

  • Posts: 0

  • Since:


高手教教我啊。。

Login

Who's Online

71 user(s) are online (47 user(s) are browsing Support Forums)


Members: 0


Guests: 71


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits