mysql_affected_row return 0 ???

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob Bedford

    mysql_affected_row return 0 ???

    I've this code:

    if(mysql_query( "delete from emails where email = '$email'",$myda tabase)){
    if(mysql_affect ed_rows()>0)
    echo('successfu ll');

    This code seems ok, but even if the query works fine (the email line is
    deleted from the mysql database), the mysql_affected_ rows is 0

    My config: XP, apache, PHP 4.3.10, mysql 4.1.10

    What's wrong with my code ?


  • Anthony Houghton

    #2
    Re: mysql_affected_ row return 0 ???

    [color=blue]
    > I've this code:
    >
    > if(mysql_query( "delete from emails where email = '$email'",$myda tabase)){
    > if(mysql_affect ed_rows()>0)
    > echo('successfu ll');
    >
    > This code seems ok, but even if the query works fine (the email line is
    > deleted from the mysql database), the mysql_affected_ rows is 0
    >
    > My config: XP, apache, PHP 4.3.10, mysql 4.1.10
    >
    > What's wrong with my code ?[/color]

    Try
    $result = mysql_query("de lete from emails where email =
    '$email'",$myda tabase);
    if (mysql_affected _rows($result)> 0)
    echo('successfu ll');
    --
    Ant


    Comment

    Working...