Jump to content

First MySQL Query.


Ruud Hermans

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.