Meltdown
11-22-2007, 12:55 AM
Here's what I want to do:
I'm working on a simple image gallery and I need to allow users to sort images into galleries they create. I'm using a dropdown to allow them to choose from galleries they have already created.
Here's what I'm using:
$result=mysql_query("SELECT DISTINCT * FROM media WHERE username='$username'");
while($row = mysql_fetch_array($result)){
//show existing galleries
echo "<option>";
echo $row['gallery'];
echo "</option>";
}
Here's my problem (if you gurus haven't discovered already):D:
Even with the DISTINCT clause in the select statement, I still have it outputting EVERY images gallery name into the drop down. (Sorry if that's not real clear. If you don't understand, I'll be glad to attempt to explain it in another way)
Thanks in advance for any help!
I'm working on a simple image gallery and I need to allow users to sort images into galleries they create. I'm using a dropdown to allow them to choose from galleries they have already created.
Here's what I'm using:
$result=mysql_query("SELECT DISTINCT * FROM media WHERE username='$username'");
while($row = mysql_fetch_array($result)){
//show existing galleries
echo "<option>";
echo $row['gallery'];
echo "</option>";
}
Here's my problem (if you gurus haven't discovered already):D:
Even with the DISTINCT clause in the select statement, I still have it outputting EVERY images gallery name into the drop down. (Sorry if that's not real clear. If you don't understand, I'll be glad to attempt to explain it in another way)
Thanks in advance for any help!