Are you set on actually storing the images in your database? have you considered, saving the images to the file system and storing the location of the image in your database instead? Each approach does have its own advantages.
JorgeM
Industrious Poster
4,018 posts since Dec 2011
Reputation Points: 297
Solved Threads: 548
Skill Endorsements: 115
How do i store the images to my file system and store the location of the images to my database
So the actual implementation depends on the server side scripting (php, asp.net, jsp), but the idea is to have an upload control on the page, capture the upload and save it to a folder on the web server or whatever storage is accessible from the web server. You then take the path of that location and file name and store it in one of your fields.
On a page where you want to display the image, you would do the reverse... read from the database, then attach that information to the 'src' attribute for the image element.
JorgeM
Industrious Poster
4,018 posts since Dec 2011
Reputation Points: 297
Solved Threads: 548
Skill Endorsements: 115
Hey PHP guys and gals... Some help here...
JorgeM
Industrious Poster
4,018 posts since Dec 2011
Reputation Points: 297
Solved Threads: 548
Skill Endorsements: 115
LastMitch
Industrious Poster
4,165 posts since Mar 2012
Reputation Points: 132
Solved Threads: 335
Skill Endorsements: 45
How do i get this code to rename the image to something unique and store the name in my table row labeled images?
I don't know.
The reason why is that you are the only one who know what table and column in your database.
You are asking me a question about rename an image and store in your table in your database?
This is the only code your provide:
GetSQLValueString($_POST['upload'], "text"),
The example from the link show what columns are in the table in the database.
LastMitch
Industrious Poster
4,165 posts since Mar 2012
Reputation Points: 132
Solved Threads: 335
Skill Endorsements: 45
I'm pretty sure that you would want to use a generate a random number and/or use a portion of the current date/time so you can rename or just append this to the file name. Or, you can keep another field in a database table and use a standard naming convention and just append a sequence number.
So your question is how to include this naming component in your PHP code.
JorgeM
Industrious Poster
4,018 posts since Dec 2011
Reputation Points: 297
Solved Threads: 548
Skill Endorsements: 115