Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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

by chromatic (Archbishop)
on Apr 17, 2000 at 21:08 UTC ( #7834=categorized answer: print w/replies, xml ) Need Help??

Q&A > database programming > What are some common causes of syntax errors in queries? - Answer 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.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2016-10-22 05:54 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (292 votes). Check out past polls.