Ok, I'm a little stumped with something, I have a playlist script that I wish to use on a number of radio stations, I'm building it so I can share particular playlist songs with other stations for simplicity, in order to do this though, I need to find a way to insert the values from 4 different checkboxes into one row, is that actually possible?
So I have my form..
PHP Code:
Citybeat:<input type="checkbox" name="station" value="citybeat" ><br />
The Bay:<input type="checkbox" name="station" value="thebay" ><br />
Lakeland:<input type="checkbox" name="station" value="lakeland"><br />
Midlands:<input type="checkbox" name="station" value="midlands"><br />
One of the suggestions made online was to do the following, no go though..
PHP Code:
Citybeat:<input type="checkbox" name=[]station value="citybeat" ><br />
The Bay:<input type="checkbox" name=[]station value="thebay" ><br />
Lakeland:<input type="checkbox" name=[]station value="lakeland"><br />
Midlands:<input type="checkbox" name=[]station value="midlands"><br />
MySQL query is as follows:
PHP Code:
$query = "INSERT INTO playlist (artistname, songname, postdate, synopsis, video, featured, list, station, image) VALUES ('$artistname','$songname','$postdate','$synopsis','$video','$featured','$list','$station','$rand_name.$file_ext')";
mysql_query($query) or die(mysql_error());
The overall goal is that I can use a url option such as showplaylist.php?station=citybeat
this will then pull from the database using the 'contains' variable..
PHP Code:
$sql="SELECT * FROM playlist WHERE station CONTAINS '$station' ORDER BY id DESC";
$result=mysql_query($sql);
I hope this makes sense, to be honest, going by my searching so far, I'm not even 100% sure it can be done..
Hope you can help!
Thanks,
Andy
