Dada78 Posted January 16, 2008 Share Posted January 16, 2008 I have set up some new columns and I just what to make sure I set it up correctly or if their is something I need to change that would make it easier. Also I need to know how to insert a picture into the database. The table is for this form.... http://www.mesquitechristmas.com/local/submit.php Now you will notice in the table below ID email and password, those are inserted when the user registers then once they are registered they are able to use the submit form which will submit their information hopefully in the same row with the registration information. here is the database -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(4) NOT NULL auto_increment, `email` varchar(65) NOT NULL default '', `password` varchar(65) NOT NULL default '', `displayname` varchar(40) NOT NULL, `displaytype` varchar(40) NOT NULL, `description` longtext NOT NULL, `address` varchar(50) NOT NULL, `address2` varchar(50) NOT NULL, `city` varchar(10) NOT NULL, `state` varchar(5) NOT NULL, `postal` int(5) NOT NULL, `country` varchar(15) NOT NULL, `website` varchar(40) NOT NULL, `imagefile` varchar(1) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=33 ; Is this set up correctly for the form I listed above? -Thanks Quote Link to comment Share on other sites More sharing options...
fenway Posted January 17, 2008 Share Posted January 17, 2008 Only for US users? What's imagefile? Quote Link to comment Share on other sites More sharing options...
Dada78 Posted January 17, 2008 Author Share Posted January 17, 2008 Only for US users? What's imagefile? Yes it is only for U.S. users and also only for people in my city and state. It is going to be a section within my Christmas Display web site where other residents around the city can post their displays for other to find during the Christmas season, but just for my city. The imagefile is the the name of the form for uploading an image from the form but I wasn't sure what to use or how to store and image so I just set it at varchar 1 until I could figure out how to learn how to do that. Any suggestions or ideas? Quote Link to comment Share on other sites More sharing options...
fenway Posted January 17, 2008 Share Posted January 17, 2008 I would allow for storage for most of the fields, no need to cut it close for a few bytes -- otherwise you'll have to deal with truncation issues/warnings. As for the images, you should store in on the file system, and record a relative path in the db. Quote Link to comment Share on other sites More sharing options...
Dada78 Posted January 19, 2008 Author Share Posted January 19, 2008 I would allow for storage for most of the fields, no need to cut it close for a few bytes -- otherwise you'll have to deal with truncation issues/warnings. I am not sure I am following you, can you explain a little more about what you mean? As for the images, you should store in on the file system, and record a relative path in the db. That is how I want to do it, just store the image in a folder and have the DB store the URL and being to call it from their. How do I go about doing that. Is their anywhere you can point to read about this or explain this to me further? -Thanks Quote Link to comment Share on other sites More sharing options...
fenway Posted January 21, 2008 Share Posted January 21, 2008 I would allow for storage for most of the fields, no need to cut it close for a few bytes -- otherwise you'll have to deal with truncation issues/warnings. I am not sure I am following you, can you explain a little more about what you mean? Your field lengths seems very strict... why not be more lenient? As for the images, you should store in on the file system, and record a relative path in the db. That is how I want to do it, just store the image in a folder and have the DB store the URL and being to call it from their. How do I go about doing that. Is their anywhere you can point to read about this or explain this to me further? -Thanks Go about doyoing what? Uploading via PHP? You'll need to post that question in the appropriate forum. Quote Link to comment Share on other sites More sharing options...
Dada78 Posted January 22, 2008 Author Share Posted January 22, 2008 Your field lengths seems very strict... why not be more lenient? Which ones are you referring to? Some of the are set to the length of the data that will be inputting. Like postal is a drop down box where they make their choice so it only needs to be 5. Pretty much City, State, Postal, Country are all set values. I don't even know why I need country now that I think of it. Quote Link to comment Share on other sites More sharing options...
fenway Posted January 23, 2008 Share Posted January 23, 2008 Your field lengths seems very strict... why not be more lenient? Which ones are you referring to? Some of the are set to the length of the data that will be inputting. Like postal is a drop down box where they make their choice so it only needs to be 5. Pretty much City, State, Postal, Country are all set values. I don't even know why I need country now that I think of it. Perhaps, but for the other fields, it seems rather short... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.