Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Re: Variable table

by Sifmole (Chaplain)
on Jan 23, 2003 at 20:34 UTC ( #229420=note: print w/ replies, xml ) Need Help??


in reply to Re: Variable table
in thread Failure plugging table into into query

Your initial question is not using a placeholder for the table name -- you are attempting to interpolate a variable to get the table name into a string which is then passed to the prepare routine. This is not working as you expect because you are using single quotes ( as stated by the previous posters ).

Make your line look like this instead and it should work:

$sth = $db->prepare("SELECT Names FROM $table WHERE Name = ?");


Comment on Re: Re: Variable table
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://229420]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2015-07-04 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls