Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
When I load the page, either adding or removing the admin "powers", it times out, then the dang site won't load for me for at least an hour. If I don't do that,
If you don't do what?
...then it just adds them or removes them depending on the action, but it don't work until they Next login.
I would find out exactly where this script is getting hung up (you say it times out, you mean it gets hung up somewhere?). And CWT::Site_DB is not a CPAN module (I assume maybe you got it from the book?), so its hard to tell what exactly is happening there. Is this vanilla MySQL with no transactions? Otherwise, I might say there's a deadlock, but I assume its not the new fangled MySQL with extra added transaction flavor. And if you clear the admin attribute, but it doesn't take effect until their next login, then are you checking for the attribute every time they request an admin page? Do the 'attr' and 'clear_attr' methods update the database immediately?

Update: Putting raw user input into SQL statements is in general a bad idea, use placeholders or at least the DBI quote() method. (Ah, tachyon mentions this below, but its worth reiterating).


In reply to Re: Sessions, Perl and MySQL by runrig
in thread Sessions, Perl and MySQL by powerhouse

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • 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.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-16 19:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found