php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #923 mysql_affectedrows returns always 0
Submitted: 1998-11-16 05:10 UTC Modified: 1998-11-16 09:01 UTC
From: marc at 5500 dot com Assigned:
Status: Closed Package: MySQL related
PHP Version: 3.0.4 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: marc at 5500 dot com
New email:
PHP Version: OS:

 

 [1998-11-16 05:10 UTC] marc at 5500 dot com
Hi, i'm using the mysql function mysql_affected_rows. The script that doesn't works is this:

<?
     $result=mysql_query("UPDATE eic_labsexresumen SET grubtab='$grubtab[$i]',grubcal='$grubcal[$i]',grubtab2='$grubtab2[$i]',grubcal2='$grubcal2[$i]' WHERE idresures=$idresures AND labaleexc=$lab[$i]");
     $num=mysql_affected_rows($result);
     if($num==0):
      mysql_query("INSERT INTO eic_labsexresumen VALUES(0,NOW(),$idresures,$lab[$i],'0','$grubtab[$i]','$grubcal[$i]','$grubtab2[$i]','$grubcal2[$i]')");
     endif;
?>

The mysql_affected_rows always returns me 0.

What I'm doing wrong?

Marc Mu?oz
marc@5500.com
Barcelona

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-11-16 09:01 UTC] rasmus
Read the manual page for that function again.  It does not take the result index as an argument.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Jun 03 09:01:26 2025 UTC