User Profile

Collapse

Profile Sidebar

Collapse
hontai
hontai
Last Activity: Feb 16 '07, 06:19 AM
Joined: Feb 15 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • hontai
    replied to wrong mySQL record updated with PHP
    in PHP
    Thank you for the suggestions, Anthony.

    There's another problem with UPDATE queries. As I understand it, all update and insert queries should return a boolean to indicate success or failure. For me, regardless of whether or not the update query changes anything, it's always returning "1". I worked around it by using mysql_affected_ rows() on the db resource, thanks to your suggestion of using mysql_num_rows( ) on the result...
    See more | Go to post

    Leave a comment:


  • hontai
    replied to wrong mySQL record updated with PHP
    in PHP
    Did some further testing, and the plot thickens.

    I removed the one record from the database, leaving it complete empty, and the UPDATE query still returns a value of 1.

    Performing a SELECT * FROM weblogins WHERE email='test@bla h.com' should also return -1, since there are no records in there, but instead returns "Resource id #6" as the result.

    ?????????

    I say, ????
    See more | Go to post

    Leave a comment:


  • hontai
    started a topic wrong mySQL record updated with PHP
    in PHP

    wrong mySQL record updated with PHP

    I've run into something that seems like a glitch, because the code and the test database are so simple that I can't fathom what could be wrong. I'm running a simple update query on a mySQL database, using PHP version 4.4.2 and mySQL 4.1.21-standard (my web host's, not my own):
    [php]

    $resetkey = (...some randomized string...);
    $query = "UPDATE weblogins SET veristring='".$ resetkey."' WHERE email='".$_POST['email']."'";
    ...
    See more | Go to post
    Last edited by ronverdonk; Feb 15 '07, 09:46 AM. Reason: code in tags
No activity results to display
Show More
Working...