General / Allgemeines > Programming

PHP MySQL question about how you put an image into a table?

(1/1)

Angelica Jolly:
Hi,

i am creating a table in php server, i am getting errors for my image this is wat my code looks like

create table houses {
id........
type.......
price......

image NOT NULL default 'unknown'

}

because i havent included a data type like char after - is that why i am getting an error, if so what data type should it be.

thanks for any help in advance

HansBr:
The data type for binary data is blob. http://dev.mysql.com/doc/refman/5.4/en/blob.html
An alternative would be, to have the image in yuor file system, and put a reference to this in the database.

Navigation

[0] Message Index

Go to full version