+ Reply to Thread
Results 1 to 3 of 3

 

Thread: PHP Help - It's Driving me nuts

  1. #1
    Member

    Status
    Offline
    Join Date
    Jan 2004
    Location
    UK
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts


    Have got the following code in my script:

    $query = "UPDATE Petitions SET signatures='$sigs', lastupdate='NOW()' WHERE pet_id='$pid'";

    $result = @mysql_query ($query);
    echo "Num $num <br>";
    $num = @mysql_num_rows ($result);
    echo "Num $num <br>";

    Problems is that even though the tables are updated with the correct values, the value of $num remains undefined. Anyone got any ideas?


  2. #2
    Registered User

    Status
    Offline
    Join Date
    Aug 2003
    Posts
    2,448
    Thanks
    0
    Thanked 0 Times in 0 Posts
    See this: - http://uk2.php.net/mysql_num_rows
    To retrieve the number of rows affected by a INSERT, UPDATE or DELETE query, use mysql_affected_rows().
    ... instead of mysql_num_rows()

  3. #3
    Member

    Status
    Offline
    Join Date
    Jan 2004
    Location
    UK
    Posts
    142
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Damn, school boy error, cheers!

+ Reply to Thread


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Content Relevant URLs by vBSEO 3.5.0 RC2