Jump to content
xisto Community

canabatz

Members
  • Content Count

    3
  • Joined

  • Last visited

Everything posted by canabatz

  1. i dont think i need to insert more two columns ,i need the a code to do like thatstart the counting from the query.if found username1 start counting if found 4 rows from username1 ,delete the last inserted bid from current user or whatever!if found less then 4 rows ,go to next user and count rows!then again go to next user ,or again if it is username1 ,start counting!!all that in a loop!!tahnx!
  2. Hello , thanx for your replay im running auction site that the user with the highest unique bid wins ,now i want to put limit on user bids on the first 50 result from the auction!! i want it to be like that!! any user will have maximum 9 bids in first 50 results ,bid 10 will be burned(deleted or something) user can have 4 bids in a row it can be like that for example ( bid 10,11,12,13 or 21,22,23,24) user cannot have bids like that (2,3,4,5,6 or 10,11,12,13,14 ) user can have only group of 4 result ,group of 5 results the last bid that is between the 4 results will be deleted!! i hope you got me better now!! i try this code but it's limiting the user to maximum 5 bids from the total 0f 50 bids: $query = mysql_query("SELECT * FROM `bidding_details` where bid_id=$bid_id and username='$username' order by bid_price desc limit 50") or die(mysql_error()); $username==$last; $last = 1; $count = 0; while ($line = mysql_fetch_array($query)) { if ($last == $line['username']) { $count++; } else { $last = 0; $count = 0; } if ($count > 4) { header("location:product_detailframe.php?msg=11&&bid_id=$bid_id"); exit; } } any help will be very very helpful !!
  3. i need to count the results sent by users ,i need a code to start counting results and find me results from the same user ,i want to be able to limit results by user ,i want to limit the user to maximum 4 rows in a run if it reaches 5 rows the result number 5 will be deleted or something ! this is my example code fo geting the results: select * from my table where username=$username and bidprice=$bid_price order by bid_price desc like this situation is good: 4 result from the same user then user 2 is between ,the result 5 from user 1 ,user 1 can continue to post more and have 4 rows in a run again!! user1user1user1user1user2 <===== there is one result between user1 so its okuser1and this way is not good: user1user1user1user1user1 <===== there is 5 result from user1 so result No. 5 will be deleteduser2thanx
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.