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:
Abatwa
Bicorn
Faerie, Banshee, Bean-Sidhe
Faerie, Brownie
Faerie, Brownie
Faerie, Pooka
Faerie, Redcap
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:
Code:
(paragraphs of description)
Source:
<a href=$sourceurl>$sourcename</a>
However, I now have an article that really contains two different sections of information, each with their own author. This means two different rows with the same $cname, $sname, and $tname, but I'd like them to be displayed on the same page, which uses a get url type method.
What I'd like to do is have it then look like:
Code:
(paragraphs of description)
Source:
<a href=$sourceurl>$sourcename</a>
(paragraphs of description)
Source:
<a href=$sourceurl>$sourcename</a>
What type of script would I use to tell the PHP page to summon both of these articles, one after another, without it going (paragraphs of description)(paragraphs of description) $sourceurl $sourceurl $sourcename $sourcename?
I still don't know why it only displays information for one of the fields, even if the names are the same.
PHP Code:
$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]'";
Wouldn't this tell it to get all the information it can, not just from one row?