Need Help inserting / retrieving images from MySQL Database
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
It's just text, so varchar should be fine.
Still not working
Thanks for the reply but I'm still stuck.
What I'm actually trying to do is retrieve the images from $_FILES, put in my current directory, store it in a variable, then send the code to the MySQL database.
How do you insert a variable into the database? Something like $img?
Any suggestions would be great.
Best way is to use the MySQLi or PDO DB extension, and make use of prepared statements in conjunction with bound parameters. (The bind-param part is where you'd get the variable value injected into the DB query.)
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)