I hope someone can help I've been trying to sort this for hours.
I am trying to pull info from my database and display everything which I have done successfully, however I have duplicate records in my database due to records in different subcategories.
Anyway I want to display everything but only once and not display the duplicates.
At pres my code is this:
<?php if(isset($_GET['alph'])){
$alph = $_GET['alph'];
$sql = "SELECT * FROM paid WHERE title LIKE '$alph%' ORDER by asc";
$query = mysql_query($sql);
while($data = mysql_fetch_array($query)){
$desc = substr($data['description'],0,100);
echo "<tr><td valign=\"top\">".$data['title']." ".$data['description']."</tr></td>";
}}
?>
Now I have tryed DISTINCT in the sql statement and that didn't work and I have tryed using array_unique() eveywhere but to be honest I'm not exactly sure how to use array_unique() with mysql_fetch_array.
If someone could point me in the right direction it will save this hole in my wall getting any bigger as I feel I can do nothing but bash my head against it.
PLEASE HELP!!