I want to be able to fetch names
from a table but distinctively (should only appear once)
Currently I'm getting: jules,ange,kapo,jules
// this is the query
$result= mysqli_query($db,"select names from uploadedproduct");
I want to be able to fetch names
from a table but distinctively (should only appear once)
Currently I'm getting: jules,ange,kapo,jules
// this is the query
$result= mysqli_query($db,"select names from uploadedproduct");
You need Distinct
$result = mysqli_query($db,"select DISTINCT names from uploadedproduct");
Distinct optimization allows to select only unique rows. The above query selects distinctively but case insensitive. For it be case sensitive, you could use BINARY opeartor:
$result = mysqli_query($db,"select DISTINCT (BINARY names) from uploadedproduct");