Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^2: Wrong SQL Syntax?

by moritz (Cardinal)
on Dec 03, 2010 at 13:22 UTC ( #875176=note: print w/replies, xml ) Need Help??

in reply to Re: Wrong SQL Syntax?
in thread Wrong SQL Syntax?

... until somebody tries to enter a username that contains a '.

Replies are listed 'Best First'.
Re^3: Wrong SQL Syntax?
by herveus (Parson) on Dec 03, 2010 at 13:42 UTC
Re^3: Wrong SQL Syntax?
by kcott (Canon) on Dec 03, 2010 at 13:47 UTC
    ... until somebody tries to enter a username that contains a '.

    No argument with that. The various responses indicating the use of placeholders (including your own) are a better general solution.

    My post was based on:

    • Frederic_S seemed to think that the quotes used in the assignment to $user_login_name would be propagated to the SELECT statement: "I thought if I pass the login_name in '' it would work ...".
    • The fact that what he was trying perhaps worked in a different language: "I'm new to perl (coming from PHP) ...".
    • The specific question asked: "... what I'm doing wrong?".
    • The code as presented which didn't indicate any user input.

    I might also point out that when I started to type up my response there where no current replies: I wasn't intending to provide a better solution or invalidate any answers that were submitted in the few minutes before my own.

    Update: Added a blockquote at the top.

    -- Ken

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://875176]
[Corion]: Do you want to wait for a key press before closing the window?
[LanX]: I want the command line in the history
[tye]: -Mouse
[Corion]: Option a) would mean launching cmd.exe /k c:\path\to\ batchfile- launching-perl- script.cmd. Option b) would be to add pause as the last line of said batch file.
[LanX]: First day after holidays ... and already stressed by the fact that colleagues changed stuff without communication ... apparently I'm the only one trying to fight entropy
[Corion]: LanX: The command is always in the history if you typed it in before. If you didn't type the command into the command line, it will not be there. I think there is doskey which can stuff command lines into the history
LanX damns the cult of CB ;-)
[LanX]: please forget my last 3 posts
[LanX]: Yeah option a doesn't go into history

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (9)
As of 2017-03-27 15:48 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (320 votes). Check out past polls.