1

Is there a way to submit jpegs to the database and then later retrieve it through the query function provided by the staff for cs50 finanace? if yes what would the column configuration for database would be and how to achieve this goal?

0

@ronga's answer may be brief, but it is correct.

The generally accepted way of storing resources such as image files in a database is by treating them as BLOBs, or Binary Large OBjects.

This approach has some pros and cons -- the obvious downside is that storing and retrieving large objects in a database can add a lot of disk I/O and make your database slow.

Another way of doing this would be to upload images to a public directory, and only store the path to the image resource in the database.

EDIT: can't reply in comments (because mobile) but here's a good place to start your research.

1
  • 1
    And what php stuff should I look into for this, besides what was taught in course... $_FILES? Oct 20 '16 at 14:24
1

Haven't tried this myself but I figure it's worth a shot:

https://dev.mysql.com/doc/refman/5.5/en/blob.html

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .