[ic] SQL as products database

Grigoriy G. Vovk Grigoriy.Vovk@linustech.com.cy
Tue, 10 Apr 2001 14:26:36 +0300 (EEST)


Apr 10, 13:09 +0300, tamas.kohegyi@unforgettable.com has written:

> > I have -
> > Database products products.txt dbi:Pg:dbname=test
> > in the catalog.cfg
> > How I can get information from the database now?
> > I've tried to use [loop] and [query sql="select * from products"] - it
> > does not work!
>
> Do not use * in your query. Try to use "select this,that from products"
> See the minivend 3.x documentation/tag reference [sql ...] tags for examples.
Ok - which difference is between interchange and minivend? I have got
documentations from interchange, so, can I use it or I should find for
minivend?

>
> > I have all information in Postgresql - users, products, etc,
> > and I want to use interchange, but I don't understand, how I can get
> > information from PostgreSQL?
>
> See the minivend 3.x documentation/tag reference [sql ...] tags for examples.
>
> you can use the [perl] tag also, e.g:
>
> [comment]
> Sql:[scratch an_sql]<BR>
> [/comment]
> <TABLE BORDER=1 CELLSPACING=0 HALIGN=CENTER WIDTH=100%>
> [perl tables="products" global=1 interpolate=1]
>   my $dbh = $Sql{products};
>   my $tmp = $Scratch->{an_sql};
>   my $sth = $dbh->prepare($tmp);
>   $sth->execute();
>   my $out;
>   my $a_reply;
>   my @record;
>   while(@record = $sth->fetchrow()) {
>     $a_reply = $Tag->area({href => 'products_detail',arg => @record[0],});
>     $out .= "<TR>\n";
>     $out .= "<TD><A href=\"$a_reply\">@record[1]</A></TD>\n";
>     $out .= "<TD>@record[2]</TD>\n";
>     $out .= "<TD>@record[3]</TD>\n";
>     $out .= "<TD>@record[4]</TD>\n";
>     $out .= "</TR>\n";
>     };
>   $out;
> [/perl]
> </TABLE>
It's _very_ intresting, b ut, without detailed documentation doesn't
usefull - I should know all about each these functions, etc.

Thank's a lot, I will try to find information, because, interchange is
very nice at first looking.

my best regards,
-----------------------------
Grigoriy G. Vovk