You are here: Re: mysql_affected_rows() question « PHP Programming Language « IT news, forums, messages
Re: mysql_affected_rows() question

Posted by Jerry Stuckle on 11/12/07 22:21

MS wrote:
> Jonas Werres emailed this:
>>> "Warning: mysql_affected_rows(): supplied argument is not a valid
>>> MySQL-Link resource in /home/fakeuser/public_html/test/adduser.php on
>>> line 104"
>>
>> PHP Manual:
>> For SELECT, SHOW, DESCRIBE, EXPLAIN and other statements returning
>> resultset, mysql_query() returns a resource on success, or FALSE on
>> error.
>> For other type of SQL statements, UPDATE, DELETE, DROP, etc,
>> mysql_query() returns TRUE on success or FALSE on error.
>>
>> So: Because TRUE is not a Resource, which is expected.
>> Ha, that was easy.
>>
>> Indeed, mysql_affected_rows() does NOT expect the return value of
>> mysql_query(), but the connection resource:
>> http://de2.php.net/manual/en/function.mysql-affected-rows.php
>>
>> So, to but it in a nutshell: RTFM!
>
> Oh, I'm so sorry! I did RTFM, but *obviously* not very effectively.
>
> Thanks for the help.
>
> Feeling humbled and very sorry.
>

Don't worry about it. This area of mysql can be confusing. So many of
the calls take a result from mysql_query(), and you would think that
this one would, also.

But alas, it's (one of) the exception(s) to the "rule". :-)

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация