Quick question about storing image NAMES in MySQL

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

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

Quick question about storing image NAMES in MySQL

Post by phpnewbie34 » 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: 1805
Joined: Thu Mar 10, 2011 5:07 pm

Re: Quick question about storing image NAMES in MySQL

Post by johnj » 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

Re: Quick question about storing image NAMES in MySQL

Post by phpnewbie34 » 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

Who is online

Users browsing this forum: No registered users and 6 guests