Results 1 to 4 of 4

Thread: Updated or not Updated $Result=1 Why

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    259

    Updated or not Updated $Result=1 Why

    in this code:

    $Sql = "UPDATE Existent SET UserName='$UserName',Existent='$Existent' WHERE Existent<1000";
    $Result = mysql_query($Sql);
    echo $Result;

    ----------
    I want to test if row is updated or not but when I echo $Result
    if row is updated $Result=1 and If row is not updated $Result=1 also .. Why ?

    How can I test if Row is updated or not ?

  2. #2
    scoutt
    Guest
    the only effiecient way to do it is to get the total rows that it updated

    and it is not good practice to name column names as the same as your table names

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2002
    Posts
    259

    ammmmmm

    I want to use Update and all that I want to know how can I know if any row(s) is changed or not.

    if any row(s) is changed give me True Else False .. How can I do that ?


    ----------

  4. #4
    Addicted Member TheGoldenShogun's Avatar
    Join Date
    Mar 2001
    Location
    VA/MD... anywhere around the beltway
    Posts
    236
    I think I answered this one in the other thread. Try using mysql_affected_rows(), that should solve your problem.

    http://www.php.net/manual/en/functio...ected-rows.php

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width