http://www.php.net/manual/en/function.mysql-affected-rows.php

On Fri, 22 Mar 2002, Ashley M. Kirchner wrote:

>
>       After a bit of research:
>
> ----------
> Rick Emery wrote:
>
> > $result = mysql_query(.....)'
> > mysql_num_rows($result)
>
>     Hrm, this is resulting in:
>
> <b>Warning</b>:  Supplied argument is not a valid MySQL result resource in
> <b>./index.php</b> on line <b>16</b><br>
>  Rows
> ----------
>
>
>       Rightfully so.  mysql_query() will only return true/false for UPDATEs
> indicating failure/success.  And, it's perfectly normal for it to be TRUE even
> if absolutely nothing was changed in the DB - the query was successful.  And
> mysql_num_rows($result) fails because $result=1 (assuming the query was valid).
>
>       So, I need a different way to approach this so I can get some type of
> indication that something did change in the DB, or whether no records were
> found in the first place.
>
>       I'd hate to have to do this in two steps, first query the DB with a SELECT
> statement, and if something was found, then do an UPDATE.
>
>       Anyone have any other ideas?
>
> --
> W | I haven't lost my mind; it's backed up on tape somewhere.
>   +--------------------------------------------------------------------
>   Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
>   IT Director / SysAdmin / WebSmith             .     800.441.3873 x130
>   Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave. #6
>   http://www.pcraft.com ..... .  .    .       Boulder, CO 80303, U.S.A.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to