Author Topic: PHP MySQL question about how you put an image into a table?  (Read 5472 times)

0 Members and 1 Guest are viewing this topic.

Offline Angelica Jolly

  • Pre-Newbie
  • Posts: 1
    • View Profile
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

Offline HansBr

  • Pre-Newbie
  • Posts: 7
    • View Profile
Re: PHP MySQL question about how you put an image into a table?
« Reply #1 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.