From: Adam Lang <aalang@rutgersinsurance.com>
Cc: pgsql-php@postgresql.org
Subject: Re: 2 more questions(Was: Re: psql with PHP question)
Date: Thu, 3 May 2001 10:28:40 -0400
Message-ID: <00fe01c0d3dd$59650640$330a0a0a@rutgersinsurance.com> (raw)
References: <3AF1427C.B4E85A45@is3-design.com>
<3AF149C1.AEC30AA9@mediaone.net>
<008b01c0d3d1$bfe11a00$330a0a0a@rutgersinsurance.com>
<3AF165D1.D9F6420E@mediaone.net>
If they are just text files, run the most current version of Postgres and
store the text in the database. The TOAST support for text is supposed to
be excellent.
Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
http://www.rutgersinsurance.com
----- Original Message -----
From: "Jason" <gee308@mediaone.net>
To: "Adam Lang" <aalang@rutgersinsurance.com>
Cc: <pgsql-php@postgresql.org>
Sent: Thursday, May 03, 2001 10:06 AM
Subject: 2 more questions(Was: Re: [PHP] psql with PHP question)
> Thanks for the help, sorry for cross posting.
> I have 2 more questions. I am a newb with psql and PHP. I am creating a
> slashdot like site. First, what is the best way to store an article?
Inside
> psql or just reference the path inside psql or is there another method? I
am
> currently using the path inside psql then use readfile() from PHP to
display
> the file. Second, Can you guys with experience tell me where I am writing
> code improperly or give some tips? This short code segment just displays
the
> article and comments posted with it. Thanks:
>
>
> <?
> include("./phpinc/psql.php");
> include("./phpinc/func.php");
> include("./phpinc/var.php");
> include("/usr/local/apache/phpinc/variables");
> include("/usr/local/apache/phpinc/header");
>
>
> if (!$conn)
> echo "Site is temporarily down";
>
> else {
> if(isset($sid)){
> $q1 = pg_Exec($conn,"select author,title,path,description from article
> where sid=$sid");
> $arr = pg_fetch_array($q1, 0);
> echo "By ". $arr["author"] .": ". $arr["title"] ."<br>";
> echo $arr["description"] ."<br><br><br>";
> echo $arr["path"]."<br>"; //this line is just for seign if the path is
set
> correctly
> readfile($arr["path"]);
> // echo $arr["path"];
>
> //next 3 lines are jut for replying to the article
> echo "<table width=100% bgcolor=$table1><tr><td align=right><form
> action=submit.php?sid=$sid method=post>";
> echo "<input type=submit value=Post></tr></td></table>";
> echo "<BR><BR><BR><BR>";
>
>
> //start the comments section here
> $q3 = pg_Exec($conn, "select cid from comment where article='$sid'");
> $maxid = pg_numrows($q3);
> $q2 = pg_Exec($conn,"select uname,time,date,post,ctitle,cid from comment
> where
> article=$sid");
> if(!empty($maxid)){
> for($i=0;$i<$maxid;$i++){
> $arr2 = pg_fetch_array($q2, $i);
> echo "By ". $arr2["uname"] .": ". $arr2["ctitle"] ."<br>";
> echo $arr2["post"] ."<br>";
> echo "<a href=./submit.php?sid=$sid&cid=". $arr2["cid"] .">Reply
to
> this</a><br><br>";
> }
> }
> }
> }
> include("/usr/local/apache/phpinc/footer");
>
> ?>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: aalang@rutgersinsurance.com
Subject: Re: 2 more questions(Was: Re: psql with PHP question)
In-Reply-To: <00fe01c0d3dd$59650640$330a0a0a@rutgersinsurance.com>
References: <3AF1427C.B4E85A45@is3-design.com> <3AF149C1.AEC30AA9@mediaone.net> <008b01c0d3d1$bfe11a00$330a0a0a@rutgersinsurance.com> <3AF165D1.D9F6420E@mediaone.net> <00fe01c0d3dd$59650640$330a0a0a@rutgersinsurance.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox