Jump to content

canabatz

Members
  • Posts

    116
  • Joined

  • Last visited

Everything posted by canabatz

  1. bid_id is the current auction . reg_id is the user id ,bid_price is the inserted bid. thanx
  2. exactly what i need! the primary key is ID.
  3. sorry ,you need the insert too! $sql="INSERT INTO `yourtable` (`item_image`) VALUES ('$item_image')"; mysql_query($sql);
  4. i got rules in the auction ,user cannot have more then 9 records in the first 50 rows if you got 9 and you send one more bid the the lowest bid is updated to be false! thats it.
  5. the order is to update the last row that it is the 10th row! so the order is starting with ASC order by bid_price asc limit 1 thanx
  6. i got auction site ,and the highest unique bid is in the top of the result ,it is the first record ,the date of the highest bid can be older or newer ! so date wont help me. any other way? please thanx
  7. this code is to store it in the database: $upload_dir="item_images"; if(!is_dir($upload_dir)) { mkdir($upload_dir,0777); } $item_image1=$_FILES['item_image']['name']; $item_image=TIME().$item_image1; $up_dir=$upload_dir.'/'.$item_image; if(move_uploaded_file($_FILES['item_image']['tmp_name'],$up_dir)) { "File Item Image Uploaded"; } else { "Item Image does not uploaded"; }
  8. ok , i got this code for limiting users for max 9 records in the first 50 rows . i want to my code to check only in the first 50 rows . now if i got lets say 70 rows ,the SELECT limit is not working , it starting from row 70 ,and i need it to look only in the 50 first rows. if you got 10 rows from the same user ,the last record will be updated to be bad! (over the rule) my quastion is how can i force this limit to look only in the first 50 rows ,so if a user have 9 rows in the first 50 is ok ,and if he got more rows from 50 to 70 it's ok then! $query = mysql_query("SELECT reg_id FROM `bidding_details` where bid_id='$bid_id' and sortbid = '1' and username='$username' limit 50") or die(mysql_error()); $last = ''; $count = 0; while($line = mysql_fetch_assoc($query)) { if($last == $line['reg_id']) $count++; else { $last = $line['reg_id']; $count = 1; } if($count > 9) { $sql_delete="update bidding_details set sortbid = '0' ,rank = '0' where bid_id='$bid_id' and username='$username' and sortbid = '1' order by bid_price asc limit 1"; mysql_query($sql_delete)or die(mysql_error()); } }
  9. it's giving me the number of rows by current user.
  10. i try your code ,but it's not working!! it's not limiting ,i can bid as much as i want!! i changed it to if($count > 4) then it is limiting me to 4 results maximum!! what i need is that user can have maximum 4 result in a row ,like groups of 4 results ,and they cannot have 5 results in a row!! and they can have few groups of 4!! im happy that you are in a good mood!! so lets try fix it
  11. me too i want to make it SOLVED Please any one! thanx
  12. this the only thing i got to solve ,and then open my site!! please help!!
  13. i have this ,but it's limiting to have maximum 4 results ,from the LIMIT 50!! $query = mysql_query("SELECT * FROM `bidding_details` where bid_id='$bid_id' and username='$username' limit 50") or die(mysql_error()); $last = ''; $count = 0; while($line = mysql_fetch_assoc($query)) { if($last == $line['username']) $count++; else { $last = $line['username']; $count = 1; } if($count == 4) { header("location:product_detailframe.php?msg=11&&bid_id=$bid_id"); exit; } } thanx
  14. i got for example this result from data base: user1 user1 user1 user2 user2 user1 user1 how can i count in php like that: user 1 have 3 in a row ,then user2 have 2 in a row ,then user1 have 2 in a row? what i want to do after is to limit users to have maximum 4 results in a row! i they get 5 in a row it will display a massage and ignore the last post!! here is example: the yellow is the last inserted row so it is not good!! there is over 4 results!! thanx in advanced!!
×
×
  • Create New...

Important Information

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.