Jump to content

selecting more than one distinct


contra10

Recommended Posts

how can i select more than one distinct

i want the name variable and the id

<?php
	 mysql_connect("localhost", "root", "") or die(mysql_error()); 
mysql_select_db("userimages") or die(mysql_error());

$queryi = "SELECT DISTINCT(name) FROM `photoalbum` WHERE `userid` = '$id'";
$resulti = mysql_query($queryi);
while($rowid = mysql_fetch_assoc($resulti))
{
	$ca= "{$rowid['name']}";
$iduu= "{$rowid['paid']}";

echo "<a href='http://localhost/photoalbum/albums.php?alb=$iduu'>$ca</a><br>"; 

}
?>

Link to comment
https://forums.phpfreaks.com/topic/143884-selecting-more-than-one-distinct/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.