Re: queries correctly in mysql, but not in php?
From: Pedro Graca (hexkid_at_dodgeit.com)
Date: 12/25/04
- Next message: Pedro Graca: "Re: array to a file"
- Previous message: m|sf|t: "Trouble uninstalling MySQL"
- In reply to: Glenn: "Re: queries correctly in mysql, but not in php?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 24 Dec 2004 23:17:03 GMT
Glenn wrote:
> Pedro Graca wrote:
>> Glenn wrote:
>>> $str_query = 'SELECT game, SUM(winloss), SUM(duration/60) FROM
>> ^^^^^^^^^ ^^^^^^
>>> $result = mysql_query($str_query);
>> ^^^^^^^^^^
>> So you're making a "SELECT" query
>>> echo 'DEBUG: Rows affected: '.mysql_affected_rows();
>> ^^^^^^^^^^^^^^^^^^^^^
>> And mysql_affected_rows() does not work with "SELECT" queries.
> No offense, but, no...
No offense taken, thank you for testing it for me (as I should have done
before posting).
After I read your post I performed a few tests here and reached the
conclusion that (for my version of PHP and MySQL) you are right.
However, according to the manual, that is not the way the function
"mysql_affected_rows()" works -- one of the user notes says that this
function is implemented as a macro in the source for mysql and works
like mysql_num_rows() -- I will stick with using mysql_num_rows() for
SELECT and mysql_affected_rows() for other types of queries.
... some time later ... [I didn't feel like deleting my previous comments]
Oops ... please disregard all of the above :-)
http://bugs.php.net/bug.php?id=30579
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
-- Mail to my "From:" address is readable by all at http://www.dodgeit.com/ == ** ## !! ------------------------------------------------ !! ## ** == TEXT-ONLY mail to the whole "Reply-To:" address ("My Name" <my@address>) may bypass my spam filter. If it does, I may reply from another address!
- Next message: Pedro Graca: "Re: array to a file"
- Previous message: m|sf|t: "Trouble uninstalling MySQL"
- In reply to: Glenn: "Re: queries correctly in mysql, but not in php?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|