PreciseGirl
7-9-04, 05:35 PM
I'm still new to PHP. I can't write much on my own, but I can usually look at code and edit it until I get it right! lol
I'm trying to make a module for my PHP Nuke. I want the page to read from a table in my database that contains different editors, their titles, and the school they are at. There are several different groups of editors (co-editors, research & book review editors, etc) and in each group there may be several names.
I can get the php to list all of the information, but not in a very practical way. I want to group all of the co-editors togeter under one heading Co-Editors, rather than listing co-editors beside every name.
So, rather than having it listed like I have it:
Co-Editors, Name, school
Co-Editors, Name, school
Co-Editors, Name, school
Research & Book Review Editors, Name, school
Research & Book Review Editors, Name, school
etc
I would like it to be something like:
Co-Editors
.....Name, school
.....Name, school
.....Name, school
Research & Book Review Editors
.....Name, school
.....Name, school
etc
my code for this part right now is:
$query = "SELECT * FROM ".$prefix."_editorialboard_text";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
while ($line = mysql_fetch_object($result)) {
echo "$line->title, $line->text, $line->school<br> \n";
}
What do I need to do to make it look nicer?
Thanks in advance, and sorry if this is a ridiculous question... I'm still learning!
I'm trying to make a module for my PHP Nuke. I want the page to read from a table in my database that contains different editors, their titles, and the school they are at. There are several different groups of editors (co-editors, research & book review editors, etc) and in each group there may be several names.
I can get the php to list all of the information, but not in a very practical way. I want to group all of the co-editors togeter under one heading Co-Editors, rather than listing co-editors beside every name.
So, rather than having it listed like I have it:
Co-Editors, Name, school
Co-Editors, Name, school
Co-Editors, Name, school
Research & Book Review Editors, Name, school
Research & Book Review Editors, Name, school
etc
I would like it to be something like:
Co-Editors
.....Name, school
.....Name, school
.....Name, school
Research & Book Review Editors
.....Name, school
.....Name, school
etc
my code for this part right now is:
$query = "SELECT * FROM ".$prefix."_editorialboard_text";
$result = mysql_query($query) or die("Query failed : " . mysql_error());
while ($line = mysql_fetch_object($result)) {
echo "$line->title, $line->text, $line->school<br> \n";
}
What do I need to do to make it look nicer?
Thanks in advance, and sorry if this is a ridiculous question... I'm still learning!