Jump to content

cmgmyr

Members
  • Posts

    1,278
  • Joined

  • Last visited

    Never

Everything posted by cmgmyr

  1. you would have to make a profile table with bandid profile website ... so you use bandid/userid as a KEY so you can relate that id to multiple tables
  2. well what I did before is add their user id to the front of the file name. but now I randomly generate a mp3 file name...then I don't have to worry about what the file name is.
  3. well thats fine...you can rename the physical mp3 files to whatever you want...but when it comes to the database you shoud stick with the auto numbers
  4. add this to your button: onclick="return confirm('Are you sure?')"
  5. but you can easily do a query to see all of the songs for an artist. i think you would be creating a lot of uneeded work for yourself doing it the way you want
  6. Change $query_id = "SELECT * FROM `membership` WHERE username='$reply_id"; to $query_id = "SELECT * FROM `membership` WHERE username=$reply_id";
  7. why don't you just use the regular auto_increment numbers?
  8. when you create the table you should add auto_increment to rateid
  9. did you try echoing the query to make sure the vaiables are coming through ok?
  10. yes that would add another row. another way that you can do it is with an update. but then you will have to enter a "totals" column to have the total amount of votes then calculate the average with "rating" and "totals"
  11. you would set the action of the form to something like "do_rate.php" do_rate.php <?php $rating = $_POST['rating']; $bandid = $_POST['bandid']; $sql = "INSERT INTO rate (rating,bandid) VALUES ('$rating', '$bandid')"; mysql_query($sql); echo "Thank you for rating!"; ?>
  12. Probably more like: rateid bandid rating 1 2 5 2 2 3 3 8 2 4 5 4 5 6 5 ...but yeah
  13. it just gives a unique id to that row
  14. yup, just another table you should have: rateid bandid rating raterid(if you are requiring a login to be able to rate)
  15. just have a radio group with the values 1-5, put a hidden field in there that has the userid of the band. When they submit the form point that to a processing script that takes the bandid and the rating and insert it into the database.
  16. cmgmyr

    Select Order

    SELECT * FROM your_table ORDER BY id ASC like that?
  17. you have to get a few more posts in order to send a PM. anyways...I think you should make a poll with MySQL it will be a lot easier to manage that way and you wont have to worry about physical files.
  18. no problem, all you need to do is ask if it is something general about php/mysql post it in here, if it is something more about a music site you can send me a PM or IM me (like how I did something)
  19. haha yes take a look at these: http://www.tizag.com/mysqlTutorial/mysqlquery.php http://www.php-mysql-tutorial.com/
  20. cmgmyr

    IPOD

    no problem, hope it works out for you
  21. yeah, then you pull out: bandid average name totalcount and away you go!
  22. here is my top 10 rating query: SELECT rate.bandid, count(rate.bandid) as totalcount, avg( rate.rating ) as average, users.name FROM rate INNER JOIN users on (users.userid = rate.bandid) WHERE users . type = 'b' GROUP BY rate.bandid having totalcount >= 10 ORDER BY average DESC, users.name ASC LIMIT 10
×
×
  • 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.