Forums

How to store (PDF-)Attachments in a database?

megachucky 01 Feb, 2010
Hi.

I have created a form with several text fields and some fields for uploads (I only accept PDFs as attachment). I selected all fields and tried to create the table. All fields are VARCHAR by default. I changed the fields for the attachments to BLOB. That should be correct, isnt it?

I use the current XAMPP version with MySQL on my local laptop. When I click "save" to create the table, the following error is displayed:

Error while creating table :You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ENGINE = MYISAM' at line 1 SQL=CREATE TABLE `jos_chronoforms_Bewerbungsformular` () ENGINE = MYISAM ;

What does it mean, what is wrong?

Thanks a lot for help...
GreyHead 01 Feb, 2010
Hi megachucky,

ChronoForms only saves the attachment file name in the database table, not the attachment file itself, so BLOB is more than is needed.

The error looks as though you are creating a table with no columns - you probably aren't selecting them in the Create Table dialogue. Selected columns are green with an 'x' icon.

Bob
megachucky 01 Feb, 2010
Ok, thank you.

Now I understand, so my problem is solved...
This topic is locked and no more replies can be posted.