
cmgmyr
-
Posts
1,278 -
Joined
-
Last visited
Never
Posts posted by cmgmyr
-
-
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
-
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.
-
he was missing the last ' in the query
-
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
-
add this to your button:
onclick="return confirm('Are you sure?')"
-
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
-
Change
$query_id = "SELECT * FROM `membership` WHERE username='$reply_id";
to
$query_id = "SELECT * FROM `membership` WHERE username=$reply_id";
-
why don't you just use the regular auto_increment numbers?
-
when you create the table you should add auto_increment to rateid
-
did you try echoing the query to make sure the vaiables are coming through ok?
-
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"
-
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!"; ?>
-
Probably more like:
rateid bandid rating
1 2 5
2 2 3
3 8 2
4 5 4
5 6 5
...but yeah
-
it just gives a unique id to that row
-
yup, just another table
you should have:
rateid
bandid
rating
raterid(if you are requiring a login to be able to rate)
-
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.
-
SELECT * FROM your_table ORDER BY id ASC
like that?
-
that is a php function
-
if you take that (int) out it should work too
-
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.
-
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)
-
-
no problem, hope it works out for you
-
yeah, then you pull out:
bandid
average
name
totalcount
and away you go!
mac users?
in Miscellaneous
Posted
ew...mac