Ruud Hermans Posted July 1, 2009 Share Posted July 1, 2009 OK, just wrote my first MySQL Query to set up some tables in a database. Could some on look over it if possible. The parts I am worried about most are these (image will hold a thumbnail). date DATE() eatable ENUM ('yes', 'no', 'partly', 'poison') comments TEXT() image BLOB() CREATE TABLE address (id INT(4) NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(30) NOT NULL, password VARCHAR(30) NOT NULL, email VARCHAR(30), location VARCHAR(30) NOT NULL, date DATE()); CREATE TABLE address (id INT(4) NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(200), latinname VARCHAR(200), date DATE(), location VARCHAR(255), eatable ENUM ('yes', 'no', 'partly', 'poison'), comments TEXT(), image BLOB()); Link to comment https://forums.phpfreaks.com/topic/164378-first-mysql-query/ Share on other sites More sharing options...
trq Posted July 1, 2009 Share Posted July 1, 2009 Its generally considered a better option to let your filesystem store images. Simply store the path to the file within your database. Link to comment https://forums.phpfreaks.com/topic/164378-first-mysql-query/#findComment-867098 Share on other sites More sharing options...
Ruud Hermans Posted July 1, 2009 Author Share Posted July 1, 2009 Its generally considered a better option to let your filesystem store images. Simply store the path to the file within your database. How would I exactly do that if the file is on a server reffer to the URL or to the path? What would it lool like in the query then, image VARCHAR(100)? Link to comment https://forums.phpfreaks.com/topic/164378-first-mysql-query/#findComment-867108 Share on other sites More sharing options...
fenway Posted July 2, 2009 Share Posted July 2, 2009 You'd store a relative pathname to the image itself. Link to comment https://forums.phpfreaks.com/topic/164378-first-mysql-query/#findComment-867490 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.