ccrevcypsys Posted October 30, 2007 Share Posted October 30, 2007 i am putting customer images on my web site and i was wondering what is the best way to set up the database table. The users will be able to comment and vote on the image. What is the best way to set up the database table? The images should be able to have titles too... Quote Link to comment https://forums.phpfreaks.com/topic/75390-whats-the-best-way-to-set-up-an-image-database-table/ Share on other sites More sharing options...
atlanta Posted October 30, 2007 Share Posted October 30, 2007 First Create a page that reads from a table that has the images url,id number and shows a picture of the image along with a comment box etc..<br> then have another table that holds the comments for certain images by id. Quote Link to comment https://forums.phpfreaks.com/topic/75390-whats-the-best-way-to-set-up-an-image-database-table/#findComment-381348 Share on other sites More sharing options...
Barand Posted October 30, 2007 Share Posted October 30, 2007 something like [pre] customer comments image --------- --------- -------- cust_id --+ id +--- image_id custname +-- cust_id | image_url eyc image_id ---+ title comment vote Quote Link to comment https://forums.phpfreaks.com/topic/75390-whats-the-best-way-to-set-up-an-image-database-table/#findComment-381354 Share on other sites More sharing options...
devain Posted October 30, 2007 Share Posted October 30, 2007 CREATE TABLE `image` ( `id` int(11) NOT NULL auto_increment, `imagename` varchar(200) default NULL, //name of the image `description` text, //description text of the image `picture` varchar(200) default NULL, // location of the image this can be used and pulled to display the image from its location as a variable `customername` varchar(200) default NULL, // customer name `customerid` varchar(200) default NULL, // unique customer id PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=0 ; something Like this Quote Link to comment https://forums.phpfreaks.com/topic/75390-whats-the-best-way-to-set-up-an-image-database-table/#findComment-381356 Share on other sites More sharing options...
ccrevcypsys Posted October 30, 2007 Author Share Posted October 30, 2007 this is what i have so far. Customer_images Image_comments Customer FavPictures ---------------- ----------------- ---------- ---------------- id --+ +-- id +--customer_id --+ id image receive_cust | first_name | favImage title comment | last_name +--customer_id story rating | screenname default customer_id --+ visible views customer_id Does this look good? Quote Link to comment https://forums.phpfreaks.com/topic/75390-whats-the-best-way-to-set-up-an-image-database-table/#findComment-381369 Share on other sites More sharing options...
Barand Posted October 30, 2007 Share Posted October 30, 2007 What is "receive_cust"? Also image_comments prob wants its own comment_id as well as the image id Quote Link to comment https://forums.phpfreaks.com/topic/75390-whats-the-best-way-to-set-up-an-image-database-table/#findComment-381385 Share on other sites More sharing options...
ccrevcypsys Posted October 30, 2007 Author Share Posted October 30, 2007 receive cust is teh customer that is receiving the comment on their image. Customer_images Image_comments Customer FavPictures ---------------- ----------------- ---------- ---------------- id --+ +-- id +--customer_id --+ id image receive_cust | first_name | favImage title comment | last_name +--customer_id story rating | screenname default customer_id --+ visible comment_id views customer_id like this Oh and i didnt mean to double post i didnt know it automatically put this thread into the mysql help board. srry about that...! Quote Link to comment https://forums.phpfreaks.com/topic/75390-whats-the-best-way-to-set-up-an-image-database-table/#findComment-381401 Share on other sites More sharing options...
Barand Posted October 30, 2007 Share Posted October 30, 2007 receive cust is teh customer that is receiving the comment on their image. You have that already -- customer id in the image table, leaving [pre] Customer_images Image_comments Customer FavPictures ---------------- ----------------- ---------- ---------------- id --+ +-- image_id +--customer_id --+ id image comment_id | first_name | favImage title comment | last_name +-- customer_id story rating | screenname default customer_id --+ visible views customer_id Quote Link to comment https://forums.phpfreaks.com/topic/75390-whats-the-best-way-to-set-up-an-image-database-table/#findComment-381410 Share on other sites More sharing options...
ccrevcypsys Posted October 30, 2007 Author Share Posted October 30, 2007 ok thanks for the help im going to keep this post open in case i need more help with it i appriciate it Quote Link to comment https://forums.phpfreaks.com/topic/75390-whats-the-best-way-to-set-up-an-image-database-table/#findComment-381444 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.