Page 1 of 1

Need help

Posted: Fri Feb 25, 2005 11:00 am
by Bonta_SWE
Hi all !
Im new at php and need some help. I have a site for my Warhammer 40k club. Members

We have some members, and i want them to upload a images of themself or something to mysql server. AND then that images should be displayed as an avatar.

My user database look like this

Code: Select all

`U_Id` bigint(20) NOT NULL auto_increment,
  `U_Username` varchar(50) NOT NULL default '',
  `U_Password` varchar(50) NOT NULL default '',
  `U_Name` varchar(50) NOT NULL default '',
  `U_Access` varchar(20) NOT NULL default '00000000',
  `U_Email` varchar(100) NOT NULL default '',
  `U_Age` bigint(20) NOT NULL default '0',
  `U_MSN` varchar(255) NOT NULL default '',
  `U_Info` blob NOT NULL,
  `U_Intresse` blob NOT NULL,
  `U_Chapter` blob NOT NULL,
  `U_Title` varchar(100) NOT NULL default '',
  `U_Medlem` tinyint(4) NOT NULL default '0',
  PRIMARY KEY  (`U_Id`)
) TYPE=MyISAM AUTO_INCREMENT=34 ;
Can someone please help me with a upload script and how to call the images ?

Thx

/Mattias

Posted: Fri Feb 25, 2005 11:11 am
by feyd
if you search on "database" and "image" you should come up with a bunch of threads. Most of which will tell you it's a bad idea to store often accessed binary data in a database.. especially images. The reason why is quite simple.. for every avatar you have to display, you must create a link that retrieves that single image from the database.

We will suggest storing just the filename or similar data in the database instead. This allows you to merely link to the proper filename.

There are hundreds of threads on upload processing.. including at least one in the Code Snippets section.