Beefy Boxes and Bandwidth Generously Provided by pair Networks httptech
There's more than one way to do things
 
PerlMonks  

Answer: What are some common causes of syntax errors in queries?

( #7834=categorized answer: print w/ replies, xml ) Need Help??

Q&A > database programming > What are some common causes of syntax errors in queries? contributed by chromatic

If you're not using the RaiseError attribute, you can check $sth->err to see if there was an error in the query. (I don't see where you specifically do any quoting of the values stored $username and $password, so that's still a possibility in my mind. btrott has a good tutorial on placeholders here.)

The other thing worth checking is: print keys %$pointer; just to see if having Login capitalized in the $user2 assignment is a problem (as it's all lowercase in the SELECT statement).

According to the Perl DBI book, some database drivers convert field names to all uppercase or all lowercase. You can coerce DBI into fixing this for you with the following modification: $pointer = $sth->fetchrow_hashref('NAME_lc'); That will make the hash keys all lowercase. 'NAME_uc' makes them all uppercase. 'NAME' is the default, doing no mangling at all.

Comment on Answer: What are some common causes of syntax errors in queries?
Select or Download Code
Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2014-04-19 21:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (483 votes), past polls