Gossamer Forum
Home : Products : DBMan : Discussions :

Call db fields in sub_html_home

Quote Reply
Call db fields in sub_html_home
Hi im trying to use a code that i found in the forum to call fields into the sub_htm_home but it displays instead of the information this character ( ; ) here is the code

my (%rec) = @_;
$in{$db_cols[$db_key]} = $db_key;
my ($status,@hits) = &query("view");
if ($status eq "ok") {
%rec=&array_to_hash(0,@hits);
$a1 =$rec{'a1'};
$ap1 = $rec{'ap1'};
$ac1 = $rec{'ac1'};
$ah1 = $rec{'ah1'};
}

this code wes used in the forum to call the users name in the db file and also other information of him,

What im doing is to let every people see without having to log you can check what im triyng to do here http://www.cineplex.org/cartelera/hoy.cgi

the db file is in http://www.cineplex.org/cartelera/xx/miembros.db

the $db_delim = ','; is that one becouse its generated by an excel sheet.

please if you know any other way of doing this please notify me please....

Regards



Quote Reply
Re: Call db fields in sub_html_home In reply to
I can't really help with the perl code, but it looks to me like your .db file might have a problem...

the first record reads:

1,1.50,Una Mujer Audaz,T.P,0:00am 4:30pm 7:00pm 9:35pm

with 5 fields (four ","s)

but all your other records only have 4 fields (3 ","s)

It probobly wont affect what your trying to do on html_home, but it could cause problems later on...

- Mark

Astro-Boy!!
http://www.zip.com.au/~astroboy/
Quote Reply
Re: Call db fields in sub_html_home In reply to
I'd like to know where you got the code you posted. That will not do what you want it to do. In fact, I don't think you can do what you want to do, if I'm understanding you correctly.

If you want to get the records that a user has added, you need to change

$in{$db_cols[$db_key]} = $db_key;

to

$in{$db_cols[$auth_user_field]} = $db_userid;

Also, you don't need the first line you have -- my (%rec) = @_;

In Reply To:
it displays instead of the information this character ( ; )
You didn't include the part of your code which displays the variables.

In Reply To:
What im doing is to let every people see without having to log
This is what you cannot do, if I understand you correctly. Users must log in so the script will know which records to retrieve.




JPD
Quote Reply
Re: Call db fields in sub_html_home In reply to
thanks for the tip jpd i maked it work.....