Quick question about storing image NAMES in MySQL

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
phpnewbie34
New php-forum User
New php-forum User
Posts: 14
Joined: Mon Apr 22, 2013 4:00 am

Mon Apr 22, 2013 4:09 am

Good morning programmers,

How do you insert an image name into a MySQL database?

For example - car.jpeg, bike.png

What is the code for storing a name with a decimal (.) in it?

Do I use blob, longblob, varchar?

Any suggestions would be great

johnj
php-forum Super User
php-forum Super User
Posts: 1803
Joined: Thu Mar 10, 2011 5:07 pm

Mon Apr 22, 2013 5:58 am

1). It is not a decimal, it is a dot
2) . Varchar is sufficient to store an image name, which is basically a string / text.

phpnewbie34
New php-forum User
New php-forum User
Posts: 14
Joined: Mon Apr 22, 2013 4:00 am

Tue Apr 23, 2013 5:11 pm

Okay I got it, thanks for your advice.

What I'm trying to do now is check to see if my picture upload properly, and to not upload the same thing twice? Do you know the code for this?

Thanks

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 4 guests