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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Sun Apr 28 14:01:29 2024 UTC