Jump to content

Uploading to PostgreSQL database


jlr2k8

Recommended Posts

I'm currently working on a website project, and I'm trying to build something where users can upload avatars to the database, instead of a folder. I have no idea how to set up that kind of system with PostgreSQL. Can someone tell me how to do this?

Thanks!
-Josh  8)
Link to comment
Share on other sites

Not sure with PostgreSQL myself but [url=http://forums.devshed.com/postgresql-help-21/storing-images-in-postgresql-database-10261.html]http://forums.devshed.com/postgresql-help-21/storing-images-in-postgresql-database-10261.html[/url] has a class there that someone uses for image uploads.

Just googled for it..

Regards
Liam
Link to comment
Share on other sites

[quote author=businessman332211 link=topic=101454.msg402826#msg402826 date=1153769120]
exact same thing just change all the my's to po's
or pg I think it is
[/quote]

actually, there are several differences in PHP functions. simply changing the mysql_ to pg_ will guarantee breakage because even the pg_connect() is handled totally differently than mysql_connect():
[code]
<?php
// mySQL
$conn = mysql_connect("$host", "$user", "$pass");
mysql_select_db("$name", $conn);

// vs PostgreSQL
$conn = pg_connect("host=$host user=$user password=$pass dbname=$name");
?>
[/code]

in addition, your advanced queries are handled differently in Postgres, and many of your keywords are different as well. in fact, even your LIMIT cannot be handled the same way. no, there is much more to it than simply changing the prefix of your functions ;-)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.