Re: [phplib] BAsic Question - DB_pgsql.inc From: Michael J. Huber (michael.huber <email protected>)
Date: 09/20/00

On Wed, 20 Sep 2000 22:05:36 +0100, Peter Bowyer wrote:

You may want to put something like this in your local.inc and not
create and instance of DB_Sql directly:

class DB_CAC2S extends DB_Sql {
  var $Host = "web.solipsys.com";
  var $Database = "cac2s";
  var $User = "cac2s";
  var $Password = "*****";
}

> include ("db_pgsql.inc");
> $db = new DB_Sql;

$db = new DB_PostCard ;

> $query = ("SELECT * FROM postcards where id=".$id);

$query = "SELECT * FROM postcards where id = " . $id ;

> $result = $db->query($query);
>
> $card = $db->next_record($result);

next_record() takes no argument.
$card should be the return code of the next_record() method, not your
data.

> $image = $card["image"];

Try $image = $db->f("image") ; to retrieve the data in the image field
of the current row.

> $to = stripslashes($card["towho"]);

I think this should be $to = stripslashes( $db->f("towho") ) ;

Good Luck.

   ________________________________________________________________
  / Michael Huber Systems Administrator \
  \_______________________Solipsys_Corporation_____________________/

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>