Thanks, this is what I wanted.



-----Original Message-----
From: Jeffl [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 07, 2001 6:09 PM
To: Imtiaz ahmad
Cc: [EMAIL PROTECTED]
Subject: Re: URL redirect and row-count


Howdy,

redirect assuming use CGI;

print q->redirect( "http://www.somewhere.org"; );

or not,

print "Location: http://www.the_other_place.org\n\n";;

counting the number of rows

select COUNT(some_column) FROM some_table WHERE some_clause;

or

SELECT COUNT DISTINCT(some_column) FROM some_table WHERE some_clause;

The above statements will return a # 

Hope that helps

jeffl

does anyone else ever find themself using esc shit : wq! for just about
everything? Sorry, I've been ear deep in code all day long......



On 2001.09.07 17:29 Imtiaz ahmad wrote:
> Hi-
> 
> Can somebody help me with a function that redirects a user's browser to a
> different site.
> I like to be able to do it using some PERL function.
> 
> Also, is there a function in PERL that tells you how many rows are
> returned
> by a select statement.
> e.g. If I have following select then what do I need to do find the total
> rows that resulted from the query:
> 
> Don't want to use any counter for the LOOP.
> 
> -----------------------------------------------------------------
> ###Select statement to pull all the advertisers
> my $check_login="SELECT         users.fullname, security.secname
>                 FROM    users, security
>                 WHERE   users.login = '$user_name'
>                 AND     users.phone = '$password'
>                 AND     users.secureid = security.secureid";
> 
> $dataObject = $dbh->prepare($check_login);
>     $dataObject->execute();
> 
> 
> while(($fullname, $secname)=$dataObject->fetchrow_array())
>         { #start of WHILE loop
> print " <TR>
>         <TD>$fullname </TD>
>         <TD>$secname</TD>
>         </TR>
> ";
>         }#close WHILE loop
> 
> -----------------------------------------------------------------
> 
> thanks.
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to