Need help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Bonta_SWE
Forum Newbie
Posts: 14
Joined: Thu Sep 18, 2003 7:04 pm
Location: Sweden, Skåne

Need help

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
Post Reply