From: Dan Nelson Date: December 29 2003 7:59pm Subject: Re: Use of Parameters List-Archive: http://lists.mysql.com/mysql/156483 Message-Id: <20031229195905.GE51168@dan.emsphone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In the last episode (Dec 29), Mario Lucero said: > I need to use this sentence with parameter but I couln't have which > is the symbol that is equal to parameter. > > For instance: SELECT * FROM EMPLOYEES WHERE last_name LIKE ? + "%" > > ? means parameter Are you sure you want to add two strings together? That's a math operation, and you'll just get zero. You probably want WHERE last_name LIKE concat(?, "%") or WHERE last_name LIKE ? , and make sure the string you're passing in has a % at the end. Note that only MySQL 4.1 and above truly support parameters (aka bind variables); if you're using mysql 3.23 or 4.0, your language's database API will have to expand them before sending the query to mySQL. -- Dan Nelson dnelson@stripped