var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Uploading an image (or link to an image) to a postgres table
Can anyone give me a basic example of how to upload an image (or link to an image) to a postgres table? I have something similar to this code below, but it isn't working... Any suggestions?
$query = sprintf ("INSERT INTO mytable VALUES ('%s')", pg_escape_string(trim($ImageFile));
Last edited by RRT; 02-01-12 at 17:23.
Reason: incomplete question.
If you are trying to hold the location of an image (such as a file path or a url), then this should simply be a text field.
If you are trying to store the actual image itself, I believe this is what the BYTEA datatype is for. PHP has a dedicated function for escaping binary data.
Thanks, that helped. I have another question related to this same topic, but will post in a new thread. Feel free to join me on that one too.
Tags for this Thread