Basic SQL question

Creating desktop or client-server database solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Ron Zellner
Posts: 106
Joined: Wed May 31, 2006 9:56 pm
Contact:

OK, that part's solved.

Post by Ron Zellner » Mon Dec 08, 2008 4:59 pm

Regarding placeholders, I added # 33 to the array in anticipation of when the submit problem would be solved- hadn't paid attention to the placeholders- that's fixed.

You were correct about double insertion- When I converted the button from the other format I didn't remove enough of that code and didn't realize the problem was coming from that level. Thanks again, that's fixed.

Now, any advice on how to retrieve the image from the SQL field? It just comes up as"âPNG" in an Excel dump.

(regarding sanitizing- I was caught up in the moment of getting a solution and focused on responding to the request- that won't happen again. I've changed my logon information just in case :oops: )

SparkOut
Posts: 2949
Joined: Sun Sep 23, 2007 4:58 pm

Post by SparkOut » Mon Dec 08, 2008 6:49 pm

That would really depend on how you're retrieving the image data and how you want it to display. I guess that the Excel dump you refer to is created by exporting a text file from mySQL, which you then open in the spreadsheet - having been exported as text data, all you will get is that view in the spreadsheet.

One thing that you might need to check is that the data type of the image field in the mySQL table is set to "blob" (binary large object).

Assuming the mySQL field is set as blob data type, to retrieve the image and display in other system somehow depends on what you're doing. Having uploaded the image data to the mySQL table, are you then using it as a web server backend and want to get a php page to retrieve it and display in the browser, for example? There's a handy little snippet that shows how here: http://www.belutz.net/2005/03/31/retrie ... using-php/

Otherwise, you will have to make a query in whatever sort of application you are creating to do the reverse of what you did in Rev to get the binary image information into the table in the first place. You could use a Rev application to query the database, and use the binary data returned to create an image, which you can then export to a file. Any other environment will require a similar process. I'm not aware of any method you could use to directly query the table with MS Excel and have the image appear in the spreadsheet - not without taking the binary data retrieved and then coding something to present it, anyway.

Ron Zellner
Posts: 106
Joined: Wed May 31, 2006 9:56 pm
Contact:

research

Post by Ron Zellner » Mon Dec 08, 2008 7:05 pm

Yes, it's a blob.
This is a research project, mainly I want to get the user's drawing for examination.
Any of your options have potential- I know I can display graphics in Excel, but not sure how to format this for display.
I'd like to retrieve it as a graphic file- (e.g. PNG) so that would be your recommended Rev query & export to a PNG file from there.
I already have it exported as a PNG file on the student computer before submission, but I wanted a copy on the server for backup and central storage/access.

I'll work on that part after I get the main instrument finished and distributed to my students. If I run into trouble on that I'll be back.
Thanks again.

Post Reply