Image data into database

Post here if you need help with SQL.
Post Reply
User avatar
Posts: 97
Joined: Thu May 19, 2011 7:37 pm
Location: Enkhuizen, Holland

Image data into database

Post by Robbedoesie »

Hello, i am trying to get the filenames from the images in the mysql database but the filenames does not shows up. I think i am using the INSERT INTO codes wrong, but i don't know where i am going wrong.

[syntax=php]$images = glob('*.{jpg,JPG,jpeg,JPEG,png,PNG,gif,GIF}', GLOB_BRACE);

mysql_query("INSERT INTO `fotogallery` . `photographs` {`id` ,`filename`} VALUES (NULL, '$images')") ;

In my database i am using
[syntax=sql]->id INT(11) NOT NULL AUTO_INCREMENT,
->filename VARCHAR(255) NOT NULL[/syntax]

I hope somebody can help me out here,
User avatar
Site Admin
Posts: 3262
Joined: Thu May 05, 2011 1:45 pm
Location: UK

Re: Image data into database

Post by jacek »

Your } brackets should be ) styles ones.
Post Reply