Hi again,
still struggling here, would appreciate it if someone could help me with the below code which fails.
The below code fails on the line:
$dbh->func( 'users', 'CSV', 'users.csv' 'ad_catalog');
Cheers!
-----------------
#!/usr/bin/perl -w
use strict;
require 'html.pl';
use lib './MyLib';
use DBI;
my $dbh = DBI->connect('dbi:AnyData(RaiseError=>1):');
$dbh->func( 'users', 'CSV', 'users.csv' 'ad_catalog');
my $sth = $dbh->prepare("SELECT surname FROM users");
$sth->execute();
while (my $row = $sth->fetch) {
print "@$row\n";
}
# define variables
header();
print("<table width='90%'>");
print("<TR valign='top'><TD width='30%'>");
print ("Menu<BR>");
print ("====<BR>");
print ("<a href='create-user.cgi'>Create New User</a><BR>");
print ("Login User<BR>");
print ("User Admin<BR>");
print("</TD>");
print("<TD>");
print ("CREATE USER<BR>");
print ("==========<BR>");
print ("This is where the code to create new users will be place
+d");
print ("<P>");
print ("USER VARIABLES<HR>");
my %user_data = qw(
id blank
first_name blank
surname blank
date_of_birth blank
email blank
password blank
active blank
last_login blank
create_date blank
earnings blank
cash blank
judoka_limit blank
sensei_limit blank
dojo_limit blank
team_limit blank
rank blank
);
open (OUTFILE, ">./user_data/test_user");
while (($a, $b) = each(%user_data)){
print ("Key = $a and its value is $b<BR>");
print OUTFILE ("$a\n$b");
}
close (OUTFILE);
print ("<HR>USERS ON SYSTEM<HR>");
opendir(USERS, "./user_data");
while ( my $name = readdir(USERS)) {
if ($name ne '.' and $name ne '..') {
print ("<a href='./user_data/$name'>$n
+ame</a><BR>");
}
}
closedir(USERS);
print("</TR>");
print("</table>");
Kia Kaha, Kia Toa, Kia Manawanui!
Be Strong, Be Brave, Be perservering!
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|