Index your database on the name and password fields and issue this query

Select count(*) where name = '$namevar' and password = '$passvar'

If count > 0 you have a hit, proceed with rest of authentication, else send 
appropriate error msg.
Whatever you do, DON'T make sequential searches through a database. They 
are agonizingly slow.

Regards - Miles Thompson

PS cs.mun.ca is different, where are you located?

At 04:31 PM 7/9/2002 -02-30, you wrote:
>I got it fixed by changing the Max Execution Time in the
>php.ini file...  However, this is ridiculously slow...   Does
>anyone else have any idea how I can run through a 4 MB+
>Database checking 2 fields Without having to wait longer
>than 30 seconds...  If it was a simple text file it would
>have been easy using different search strategies (possibly
>even Hashing Keys...)
>
>Please give me some suggesstions...
>
>Kondwani...
>"Kondwani Spike Mkandawire" <[EMAIL PROTECTED]> wrote in message
>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > The function shown below only functions with my
> > Apache on WinNT...  I have tried it on my local
> > Server (thats the one running the Apache and
> > it works perfectly)...  I am trying to step through
> > a moderately large database (4MB)...  However when
> > I tried the example on the Server for my Work
> > Place it returned an error stating that the Script
> > took longer than 30 seconds to execute hence
> > failed...  When I search for a name at the top of
> > the Database it immeadiately Spits out Found!...
> > The server on which this fails is an IIS WebServer, I am
> > not quite sure what version it is...  I am kind of
> > at a loss whether its to do with the scripts efficiency
> > or the Servers Settings...  Why is it possible to
> > execute the Script easily on my local host...
> >
> > Here is the location...
> >
> > http://www.coop.mun.ca/verification.php
> >
> > Try and Type in any Name...  As it should simply
> > Step through the Database not find it and Respit the Page...
> > However this does not happn...
> >
> > Please Help...
> >
> > if (function_exists(odbc_fetch_array))
> >   return;
> >
> > function odbc_fetch_array($result, $rownumber=-1) {
> >   if (PHP_VERSION > "4.1") {
> >     if ($rownumber < 0) {
> >       odbc_fetch_into($result, &$rs);
> >     } else {
> >       odbc_fetch_into($result, &$rs, $rownumber);
> >     }
> >   } else {
> >     odbc_fetch_into($result, $rownumber, &$rs);
> >   }
> >   foreach ($rs as $key => $value) {
> >     $rs_assoc[odbc_field_name($result, $key+1)] = $value;
> >   }
> >   return $rs_assoc;
> > }
> >
> >
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to