Mike Gleason Jr Couturier writes:
> Hello all !
> 
> I'm creating a program that let the user do any
> query (select, update, insert) on a connection...
> But I think that when we store() the query, the
> function returns different values based on the type
> of query (insert, select..). How can I retreive the
> number of row updated (If it is an update or if a
> insert was successful) or the results (If the query
> was a select) ? I would like to let the user to do
> any query... Can you point me to some examples ?
> 
> Thank you very much to take some time to read this...
> 
> Mike

Hi!

Regardless of which API you use , you can not treat each query the
same.

You should check if it is a command that returns rows, like SELECT or
SHOW, or a command that does not.

First ones should use :

query << "...";
Result res=query.store();

Second one should use query->exec() or execute() (depending on whether
you use SSQL embedded commands or similar) and some of the methods
that return affected / found rows.

Read MySQL++ manual for details.

-- 
Regards,
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Mr. Sinisa Milivojevic <[EMAIL PROTECTED]>
 / /|_/ / // /\ \/ /_/ / /__   MySQL AB, Fulltime Developer
/_/  /_/\_, /___/\___\_\___/   Larnaca, Cyprus
       <___/   www.mysql.com


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to