Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 8F05E9FB2C2 for ; Mon, 9 Oct 2006 02:52:25 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 14886-01 for ; Mon, 9 Oct 2006 05:51:53 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.181]) by postgresql.org (Postfix) with ESMTP id C9D269FB2C9 for ; Mon, 9 Oct 2006 02:51:52 -0300 (ADT) Received: by py-out-1112.google.com with SMTP id d80so2112504pyd for ; Sun, 08 Oct 2006 22:51:51 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding; b=JVrdwkVilc/bHBbEfRswuwAbkAYAnrzGljTlBubphWjeWiLvZ1YKLxn2suS4+ib9BS5ZtFDZ8JK/NSAuK7bzD4LH+U/4SNR1kQgChHTjufJIVJLLfkVN9oJ8cb2CQwwLCm7sMWVGWuOPFY/LEenNSri0VF+p7AQwwq0RF/jcMgo= Received: by 10.64.148.8 with SMTP id v8mr8441859qbd; Sun, 08 Oct 2006 22:51:51 -0700 (PDT) Received: from ?10.1.1.14? ( [203.217.18.65]) by mx.google.com with ESMTP id f16sm6557447qba.2006.10.08.22.51.49; Sun, 08 Oct 2006 22:51:51 -0700 (PDT) Message-ID: <4529E372.8060708@gmail.com> Date: Mon, 09 Oct 2006 15:51:46 +1000 From: Chris User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: ben wilko CC: pgsql-php@postgresql.org Subject: Re: Tutorial/Example of Insert/Select PDF Postgres DB ? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200610/9 X-Sequence-Number: 3609 Firstly always CC the mailing list. ben wilko wrote: > I am looking to have a dynamic page which will allow users to select > categories in which a corresponding PDF file will be accessible to them. That doesn't make any difference.. It becomes two database tables: create table downloadfile (fileid serial primary key, filename text); create table downloadfile_categories (fileid int references downloadfile (fileid), categoryid int references categories (categoryid)); then a file can be available for multiple categories and so on. If you really want to store binary data in the database, start here: http://www.postgresql.org/docs/8.1/static/datatype-binary.html and here: http://php.net/pg_escape_bytea -- Postgresql & php tutorials http://www.designmagick.com/