List:General Discussion« Previous MessageNext Message »
From:Steve_HOUCHEN Date:April 17 1999 1:54pm
Subject:Problem with PHP 3.0.7 mysql_affected_rows(), MySQL 3.22.21
View as plain text  
Hello.
     I am somewhat new to PHP and MySQL.  I have MySQL 3.22.20a and PHP
3.0.7 working with my Apache 1.3.4 web server on Red Hat Linux 5.2 at home.
However, I am trying to start using these tools on my company's intranet. I
am using MySQL 3.22.21 (binary distribution for aix4.2.1.0 on powerpc), PHP
3.0.7, and Apache 1.3.6 on AIX 4.3.2
     Everything I have tried so far works nicely, except for
mysql_affected_rows().  The following script outputs "Affected rows: 0",
even if a row has been updated:
<SCRIPT language=php>
$db=mysql_connect("my_host","my_user");
mysql_select_db("www",$db);
$query_string="update pagers set owner_name='Blah Blah Blah' where
pager_id=11";
$result=mysql_query($query_string,$db);
print "Affected rows: ".mysql_affected_rows($db);
mysql_close($db);
</SCRIPT>
I have verified that the update happens, but mysql_affected_rows() returns
0.  If I use mysql to issue update commands to the database, it returns the
proper number of affected rows.
This problem showed up when I started trying to use phplib-6.1 on the
server at work.  (It works on Linux at home.)
The call to mysql_affected_rows() is returning 0 and causing a problem in
the freeze() function in session.inc
I would appreciate any help that you can give!  I have searched archives
for MySQL and PHP, and didn't find any answers to this problem.

I have also posted this to the php3 mailing list.  I apologize if you
received duplicates.  I don't know if this is a problem with my
environment, PHP, or the MySQL libraries linked into PHP.

Thanks,
Steve Houchen, steve_houchen@stripped
ENOVIA Corp.   (704) 944-8942   FAX: (704) 944-8888
10926 David Taylor Drive, Suite 300
Charlotte, NC  28262


Thread
Problem with PHP 3.0.7 mysql_affected_rows(), MySQL 3.22.21Steve_HOUCHEN17 Apr
  • Problem with PHP 3.0.7 mysql_affected_rows(), MySQL 3.22.21Michael Widenius18 Apr