4images Forum & Community

General / Allgemeines => Programming => Topic started by: Angelica Jolly on May 18, 2009, 09:29:25 AM

Title: PHP MySQL question about how you put an image into a table?
Post by: Angelica Jolly on May 18, 2009, 09:29:25 AM
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
Title: Re: PHP MySQL question about how you put an image into a table?
Post by: HansBr on May 26, 2009, 08:24:54 AM
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.