Jump to content

Recommended Posts

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

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.