[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-plusplus
Subject:    RE: mysql++ and "UPDATE" querys?
From:       "Steve Roberts" <s.roberts () f5 ! com>
Date:       2005-01-07 21:52:33
Message-ID: 8AF76A158D6BCE45B90202EE6C9537F15F9F4C () exchfour ! olympus ! f5net ! com
[Download RAW message or body]

Try this: 
try {
    query << "update .... where id = " << mysql::quote << var;
    query.preview();	// To see if the query looks right
    query.execute();
} catch (std::exception& e) {
    cerr << "Query failed: " << e.what();
}

Also see earlier discussion of configuring with "--with-exception"

-SR

> -----Original Message-----
> From: Pascal Bissig [mailto:pascal.bissig@gmx.ch] 
> Sent: Friday, January 07, 2005 1:25 PM
> To: plusplus@lists.mysql.com
> Subject: mysql++ and "UPDATE" querys?
> 
> 
> Hi,
> 
> (17, less C++ experience, some PHP experience) (SuSE 9.0)
> 
> I just succeded compiling an empty Project with all the 
> headers and Lib's.
> Now there is yet a new problem, i used mysql with php. Now i 
> wanted to update my table like in PHP with a query:
> 
> query << "UPDATE einheit_user SET mounted=1 WHERE id='" << var << "'";
> 
> But nothing happend, i tried executing the query with 
> PhpMyAdmin, it worked perfectly. Where is the problem? Is it 
> possible to update tables as easy as in PHP?
> 
> 
> I also tried "executing" the query:
> 
> query.execute();
> 
> But this way the Program "Aborted" while running.
> 
> 
> Thank you for your help
> 
> -- 
> +++ GMX - die erste Adresse für Mail, Message, More +++
> 1 GB Mailbox bereits in GMX FreeMail http://www.gmx.net/de/go/mail
> 
> -- 
> MySQL++ Mailing List
> For list archives: http://lists.mysql.com/plusplus
> To unsubscribe:    
> http://lists.mysql.com/plusplus?unsub=s.roberts@f5.com
> 
> 
> 

-- 
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:    http://lists.mysql.com/plusplus?unsub=mysql-plusplus@progressive-comp.com


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic