|
|
Sponsor |
Re: Mysql++ && printf: msg#00035db.mysql.c++
On Sun, Apr 10, 2005 at 07:47:52PM -0700, timothy johnson wrote: > What about using vars in the query line? > > query << "SELECT * FROM table WHERE id=" . var; > this way didnt work > > sprintf(query. "SELECT * FROM table WHERE id=%i". var); > nor did this way work. This is C++, not PHP or perl. query << "SELECT * FROM table WHERE id=" << var; If you're building SQL from scratch, make sure you quote properly as well. Going from memory, I think you use the quote manipulator like this, but I could be wrong, I don't use it regularly: query << "SELECT * FROM table WHERE id=" << quote << var; - Chris -- MySQL++ Mailing List For list archives: http://lists.mysql.com/plusplus To unsubscribe: http://lists.mysql.com/plusplus?unsub=gcdmc-plusplus@xxxxxxxxxxx
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Mysql++ && printf, timothy johnson |
|---|---|
| Next by Date: | Re: RFC: Row::operator[] change, Bruce Keats |
| Previous by Thread: | Re: Mysql++ && printf, timothy johnson |
| Next by Thread: | Re: Mysql++ && printf, Warren Young |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |
Home | sitemap
| advertise | OSDir is
an inevitable website.
|