|
From: Jamie C. <jca...@we...> - 2005-12-30 04:00:30
|
No, you can't use parameters for field names either, sorry ... mainly because MySQL doesn't support it. - Jamie -----Original Message----- From: "Grant Peel" <gp...@th...> Subj: Re: [webmin-l] Custom Mysql Date: Fri 30 Dec 2005 1:21 pm Size: 2K To: <web...@li...> :-) Sorry Jamie, not the table name ... this part: WHERE ? LIKE ?; the first ? would not work. (to select the field or column name.). ----- Original Message ----- From: "Jamie Cameron" <jca...@we...> To: <web...@li...> Sent: Friday, December 30, 2005 1:10 PM Subject: Re: [webmin-l] Custom Mysql Hi Grant, Unfortunately you can't use table names as parameters like that. Only values in the SQL expressions can be parameters, like in my original example.. - Jamie -----Original Message----- From: "Grant Peel" <gp...@th...> Subj: Re: [webmin-l] Custom Mysql Date: Fri 30 Dec 2005 10:32 am Size: 2K To: <web...@li...> Kewl, -thanks! should this work? SELECT user, ip, domain FROM tbl_name When I replace the first ? with a real field name (ie 'domain') it works fine. But when I run the above, it just shows the column names with no data. -Grant P.S. I have a local copy of the Mysql handbook, and am reading :-) ----- Original Message ----- From: "Jamie Cameron" <jca...@we...> To: <web...@li...> Sent: Friday, December 30, 2005 9:14 AM Subject: Re: [webmin-l] Custom Mysql Hi Grant, The SQL custom commands use a ? to indicate a parameter, which is standard with SQL. The first parameter in the command will replace the first ? and so on .. - Jamie -----Original Message----- From: "Grant Peel" <gp...@th...> Subj: [webmin-l] Custom Mysql Date: Fri 30 Dec 2005 3:16 am Size: 1017 bytes To: <web...@li...> Hi all, FOrgive me if this has been covered somewhere else, but how does one use parameters in the custom->sql commands section? I keep getting errore like these: Executing SQL command SET par1=$INPUT; SET par2=$FIELD; SELECT user, password, domain, ip, host_machine FROM clients WHERE domain LIKE @par1; .. .. execution error : called with 1 bind variables when 0 are needed I get them even if I don't use the 'set' variables parm. I have tried every escape sequence I can think of. --- message truncated --- |