Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
01-31-2009, 09:13 PM #1
- Join Date
- Aug 2008
- Thanked 3 Times in 3 Posts
Rid duplicates in list due to 1 < fields & how to get multiple entries on same page
I have a mythology project I've been working on for a few years.
First I have a list of the data displayed from sql onto a php page, that looks something like this:
Faerie, Banshee, Bean-Sidhe
The first words are $name, the secondary ones (like Brownie) are $sname, and the third are $tname. How can I tell this list to distinctly display only one version of what there is?
Secondly comes the problem of displaying the information. I didn't have a problem before but now I have more than one 'article' of information by two different sources.
As it is now I have fields sorta like this:
$idata: Paragraphs of Description
$sourcename: Name of Source
$sourceurl: Source URL
And then on a PHP page I tell it to display all of these. This isn't the exact code but just a summary:
(paragraphs of description) Source: <a href=$sourceurl>$sourcename</a>
What I'd like to do is have it then look like:
(paragraphs of description) Source: <a href=$sourceurl>$sourcename</a> (paragraphs of description) Source: <a href=$sourceurl>$sourcename</a>
I still don't know why it only displays information for one of the fields, even if the names are the same.
$sql .= "SELECT * FROM creatures where name = '$_GET[name]'";
if (!empty($sname)) $sql .= " AND sname = '$_GET[sname]'";
if (!empty($tname)) $sql .= " AND tname = '$_GET[tname]'";
if (!empty($source)) $sql .= " AND createdby = '$_GET[source]'";
Last edited by TwilightRealm; 01-31-2009 at 09:20 PM.