pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PJourdan <info@lespetitsplaisirs.com>
To: pgsql-php@postgresql.org
Subject: database query
Date: Tue, 30 Apr 2002 14:57:51 -0400
Message-ID: <5.1.0.14.2.20020430144126.00ad01a0@mail.host45.com> (raw)

I am new to php & pgsql and am having some problems with a database query.
I have reconstructed a defunct website on my local FreeBSD machine. On the 
site everything worked fine. On the local machine, after some problems in 
reconstructing the pg database, the main site functions fairly well. The 
problem is in the administration section. This is accessed from another 
directory /radm.

1) On original site, access to the login (passwd, username) was 
www.sitename.com/radm. On local machine, I must now enter 
192.168.1.25/radm/index.php. Then it works.

2) When I try to access the product administration page, no products are 
displayed. The web pages showing the products normally work fine and the 
products are seen with minor glitches. But the admin code does not seem to 
access the database. No db errors are generated. Apparently the queries 
were designed for pg 7.0 and I am now using 7.2.1_1.
What seems to be wrong? Thanks in advance
Philip Jourdan

Here is a snippet:

include "$DOCUMENT_ROOT/../lib/general.conf";
$user_id=CheckUser(3);
no_cache();
include "admin.php";
$page_id=2;
if(!isset($id)) $id=0;
if(!isset($op)) $op='';

$path='';
if(isset($filter) && $filter=='Search') {
     $path='Search-&gt;';
}
else {
     list($path)=sqlget("select name from category where category_id='$id'");
}
if($op=='ca_add') $path.='-&gt;Add New Category';
if($op=='w_add') $path.='-&gt;Add New Product';
if($op=='w_edit') {
     list($caname)=sqlget("
     select name from wares_category,category
	where wares_category.ware_id='$id' and
	category.category_id=wares_category.category_id
     limit 1");
     list($wname)=sqlget("select name from wares where ware_id='$id'");
     $path="$caname-&gt;$wname (edit)";
}
ShowHeader("Admin-&gt;Products-&gt;$path");
if($op=='ca_edit' || $op=='ca_add' || (isset($check) &&
	    $check=='Update category') && has_right($user_id,$page_id,'S')>0) {
     if($op=='ca_edit') {
	list($root_id,$archived,$hidden,$name,$color,$image,$comments)=sqlget("
	    select root_id,archived,hidden,name,color,image,comments
	    from category where category_id=$id");
     }
     else {
	$root_id=$id;
	$archived=$hidden='f';
	$name='';
	$color='lightblue';
	$image=$comments='';
     }
     BeginForm();
     InputField("Name",'f_name', array('required'=>'yes','default'=>$name));
     InputField("Archived",'f_arch', 
array('required'=>'yes','default'=>$archived,
	'type'=>'select','combo'=>array('f'=>'No','t'=>'Yes')));
     InputField("Hidden",'f_hidden', 
array('required'=>'yes','default'=>$hidden,
	'type'=>'select','combo'=>array('f'=>'No','t'=>'Yes')));
     InputField("Color",'f_color', array('required'=>'yes','default'=>$color));
     InputField("Image",'f_image', array('default'=>$image));
     InputField("Comments",'f_comments', 
array('default'=>$comments,'type'=>'textarea','fparam'=>' rows=5 cols=58 
wrap=virtual'));
     FrmEcho("<input type=hidden name=id value=$id>");
     FrmEcho("<input type=hidden name=op value=$op>");
     EndForm('Update category');
     ShowForm();
} 




Message-ID: <5.1.0.14.2.20020430144126.00ad01a0@mail.host45.com>
Permalink:  ../5.1.0.14.2.20020430144126.00ad01a0@mail.host45.com/
Also on:    postgresql.org/message-id/5.1.0.14.2.20020430144126.00ad01a0@mail.host45.com

 · 

reply

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: info@lespetitsplaisirs.com
  Subject: Re: database query
  In-Reply-To: <5.1.0.14.2.20020430144126.00ad01a0@mail.host45.com>
  References: <5.1.0.14.2.20020430144126.00ad01a0@mail.host45.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