Nope,
Sorry, but nowhere I was thinking about the boolean value.
I was only talking about the return value of mysql_affected_rows(Mysql
*)and it's return type is (unsigned int), which depends upon the no of
rows affected by the last query. 
I have just ask you based upon a very rough table( flag_test)..
So, there is no question of returning boolean value..I think you
interpreted it wrongly. isn't it ??

By the way, thanks for your suggestion.

Thanks and regards,
Chetan Lavti



  

-----Original Message-----
From: John Dean [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 01, 2002 5:25 PM
To: DL Neil; Chetan Lavti; [EMAIL PROTECTED]
Subject: Re: Row affected from Mysql Command line and api's


Hi
I think you need to read a book on C since C has no notion of a boolean
value

At 11:40 01/03/2002 +0000, DL Neil wrote:
>Hi Chetan,
>
>Suppose I have a table :
>
>mysql> select * from flag_test;
>+--------+------+
>| name   | flag |
>+--------+------+
>| Chetan | Y    |
>+--------+------+
>1 row in set (0.00 sec)
>
>I am setting/unsetting the flag field from the api's ;
>
>Now if the flag is already set and I executes the Query from the Mysql
>Command prompt it shows :
>MySQL> update flag_test set flag='Y' where name='chetan';
>Query OK, 0 rows affected (0.00 sec)
>Rows matched: 1  Changed: 0  Warnings: 0
>
>but if the same Query I run from the C program and if I check the
return
>value of mysql_affected_rows(Mysql *) it returns 0 ,
>Actually I am doing something based on it's return value but Instead of
>Rows matched: 1
>
>
>=The function only returns the number of rows "affected"/updated, not
>the number of rows "matched" (in the WHERE clause). In this case, if
the
>flat was already "Y" (your interaction from the MySQL client), then the
>C program will not have had a change to make - and not counted it as
>"affected".
>
>=Change the flag to non-Y, and then re-run the C prog.
>
>=Regards,
>=dn
>
>
>
>---------------------------------------------------------------------
>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

Regards
John,
Former MySQL Developer

-----
[EMAIL PROTECTED]
http://www.rygannon.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