Page 1 of 1

Blobbing PDF with conditions

Posted: Sat Jan 08, 2005 11:06 am
by Micah_geek
I have a database schema like so,
DATE - a date formatted by date('Ymd')
TITLE - The name of the PDF
file - a blob for the PDF

I run a group, and I would like to provide the lessons on my site. I can only post 1 lesson, so I need a way to check that it was the latest lesson. What I have done is have two frames, one displaying the Header for my site and the Title of the lesson. The other contains a PDF of the file. Does anyone have some code I could use to achieve my goals. I do not need the Frameset, but I HAVE to have only the LATEST lesson.

Thank you for any help

Micah :D

Posted: Sat Jan 08, 2005 11:22 am
by feyd

Code: Select all

SELECT `DATE`, `TITLE` FROM `your_table` WHERE `DATE` <= (CURDATE() + 0) ORDER BY `DATE` DESC LIMIT 1
since you've decided to store the binary inside the database, you'll need to pass information to the second frame to load that out of the database. You can pass this information through a variety of means, but often the easiest, is through $_GET. I'd pass the id, if you have it, or the date, so you can use a script to find the correct file. We often suggest not storing binaries in the database because to display them requires an additional database query.

smartknight

Posted: Sat Jan 08, 2005 12:27 pm
by smartknight
hi,


thanks for this information.


thanks & regards,

smartknight