Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

how to get data from the mysql database

Quote Reply
how to get data from the mysql database
Hi there,

I hope that someone can help me starting to integrate my .cgi I used with links 2.0 for links sql. I need to access some data from the links database and had it stored in an array before. The code was like:

open(PRODUCTS, $PRODUCT_INFO)
| | &ws_error('open->product_info', $PRODUCT_INFO);
while ($record= <PRODUCTS> ) {
local($ref_name, $name, $weight, $datum, $filename, $note, $price, $euro) = split(/\Q|\E/o, $record);
$PRODUCT_WEIGHT{$ref_name} = $weight;
$CONFIG{'PRODUCT_WEIGHT_' . $ref_name} = $weight;
$PRODUCT_NAME{$ref_name} = $name;
$CONFIG{'PRODUCT_NAME_' . $ref_name} = $name;
$PRODUCT_COST{$ref_name} = $price;
$CONFIG{'PRODUCT_PRICE_' . $ref_name} = $price;
$PRODUCT_NR{$ref_name} = $ref_name;
$CONFIG{'PRODUCT_NR_' . $ref_name} = $ref_name;

push(@products, $ref_name);
}
close(PRODUCTS);

I know that I have to add:
use CGI ();
use CGI::Carp qw/fatalsToBrowser/;
use Links;
use Links: BSQL;
use Links: B_Utils;
use Links::HTML_Templates;
use strict;
use vars qw($USE_HTML $LINKDB $CATDB $EMAIL $HIERARCH $GRAND_TOTAL);
$|++;

but I donīt know how I can access the data then. Thanks for your help

Niko
Subject Author Views Date
Thread how to get data from the mysql database el noe 1384 May 13, 2000, 5:59 AM
Post Re: how to get data from the mysql database
pugdog 1345 May 13, 2000, 12:23 PM
Post Re: how to get data from the mysql database
el noe 1345 May 14, 2000, 5:33 AM