Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder darksecu's Avatar
    Join Date
    Dec 2011
    Location
    India
    Posts
    96
    Thanks
    11
    Thanked 1 Time in 1 Post

    Fetching And Updating

    Code:
    $textads=mysql_fetch_array(mysql_query("SELECT * FROM ads where text='1' and expired='0' ORDER BY RAND() LIMIT 1"));
    $adsid=$textads['id'];
    $adsusername=$textads['username'];
    
    
    
    
    mysql_query("update ads set impdone=impdone+1 where id=$adsid");
    This code should fetch 1 result, its fetching only 1 result but its updating 2 random rows with impdone+1 value ...
    please tell me whether the code is ok or not ?? and solution
    Last edited by darksecu; 04-16-2012 at 10:48 AM.


 

Posting Permissions

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