It is not clear to me on how to return the error or sucess on the query?
If (my @rs = &getSQL("LMS_USER","USER_NAME,EMAIL,USER_ID,IS_GUEST,STATUS","EMAIL='$NewEmail' and STATUS='active'") <> 1){
print "fail:";
}else{
print "OK";
}
Thanks,
Chip
OK I figured it out.
About time I figured something out myself for a change.
What I need to do is insert a \ before the @ like below:
stephi.ahn\@some.com
So I will format the string before searching on it.
Thanks
Chip
OK I forgot to say that the email address comes in a CVS file and so i get it in a var.
It would look somthing like this:
# open file
open (TXTFILE, "c:/SOARimports/NU_AD2032_ILINC_EXTRACT_stf.csv") or die("Unable to open file");;
@lines = <TXTFILE>;
# read file into an array
foreach...
OK I forgot to say that the email address comes in a CVS file and so i get it in a var.
It would look somthing like this:
# open file
open (TXTFILE, "c:/SOARimports/NU_AD2032_ILINC_EXTRACT_stf.csv") or die("Unable to open file");;
@lines = <TXTFILE>;
# read file into an array
foreach...
This works fine:
my @rs = &getSQL("LMS_USER","USER_NAME,EMAIL,USER_ID","USER_NAME='test1'");
However I need to find by the email address like so:
my @rs = &getSQL("LMS_USER","USER_NAME,EMAIL,USER_ID","EMAIL='test1@something.com'");
How do I need to format the select statment so it will accept...
Also to bother you more:
I am traying to delete by email address. I think "@" is not a legal char in perl to use so i have tried this:
my $rec = &delSQL("LMS_USER","EMAIL='<![CDATA[ameer.alam@home.com]]>'");
But it does not work. I get a script failed error.
This works fine.
my $rec =...
OK how do I put the values into var?
my @rs = &getSQL("LMS_USER","USER_NAME,EMAIL","USER_NAME='005861539'");
my $NewValue = "$_->{'EMAIL'}\n"; #<- how to assign to var?
print "$NewValue\n";
for(@rs){
print "$_->{'EMAIL'}\n"
}
Thanks
Chip
Wow! I am impressed. This module worked on the first try! This makes life a lot easier and it is Friday to boot. Thanks so much for taking the time to help out.
Hope I can return the favor to some one.
Chip
OK I tried your line of code but it does not print out anything to the web page. We are running Windows 2003 server with IIS. The web site that I am working with is written in Perl.
Why does perl not print the errors? Am I missing a module?
The web site is a distant learning piece of software...
Do you use Win32 ODBC in a web page .pl?
Can you send me some sample code? A simple select statement and a retrieval of a filed printed to the web page?
Much appreciated.
I have ordered another book "Programming the Perl DBI [Illustrated] [Paperback] by Bunce, Tim
because the first one...
I have ordered the book:
Real World SQL Server Administration with Perl
hoping that it will shed some light on getting data from SQL. I have also been looking for the DBI docs in Perl but have not found them. time to google them.
Thanks,
Chip
OK it looks like the code I found on the web (this code I am trying to use, is PHP not Perl). It looked like Perl to me but then what do I know I am a beginner in Perl. That is what DB_Sql is, a part of PHP.
"PHPlib also has several helper classes, prominent amongst them are the DB_sql...
I googled an article on DB_Sql and am looking to see if it is part of Perl or what it is. Also why would it be needed in this code?
DB_Sql Examples
Use a subclass to provide the appropriate parameters for a database connect. You may overwrite halt() to customize the error message, although a...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.