Formatting MySQL Tables
Hi There,
I was wondering if it was possible to show individuals information in seperate tables like this:
Title1 content
Title2 content
Title3 cont...
Using php I can show information in a list ie:
Title 1 Title 2 Title 3 ....
content comtent comtent ....
I am reasonbly new toall so any help would be appriecated.
Thanks
Gman
Northern Ireland Motorsport
http://www.nimotorsport.co.uk
Mark Hensler posted this at 05:38 — 2nd April 2001.
He has: 4,048 posts
Joined: Aug 2000
can you post the code you have?
Gman posted this at 10:08 — 2nd April 2001.
They have: 5 posts
Joined: Feb 2001
Here you go. I have left the top section out:
$query_result = mysql_query ("select date, event, club, status, notes from autotest order by date", $connection);
$mandate = "00-00-0000";
list($month, $day, $year) = sscanf($mandate,"%s %d %d");
if (mysql_num_rows ($query_result) >0){
print "\n";
print "DateEvent
ClubStatusContact\n";
while ($row = mysql_fetch_array($query_result)) {
print "";
print "".$row["date"]."".$row["event"]."".$row["club"]."".$row["status"]."".$row["notes"]."";
print "\n";
}
print "\n";
}
?>
Its not very neat I'm afriad
Gman
Northern Ireland Motorsport
http://www.nimotorsport.co.uk
Peter J. Boettcher posted this at 13:09 — 2nd April 2001.
They have: 812 posts
Joined: Feb 2000
Gman,
Just add the headings to be beside the database values instead of on top:
print "";
print "Date: ".$row["date"]."\n";
Repeat as necessary.
Gman posted this at 13:23 — 2nd April 2001.
They have: 5 posts
Joined: Feb 2001
Many Thanks.
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.