MySQL Forums
Forum List  »  Newbie

Re: Display sum of table in one line of text?
Posted by: Matthew Jones
Date: March 29, 2005 05:29AM

I thought maybe it would help if I give you the url of the page, so you can see what it is displaying, and what it will display. http://www.tangoforce.com/coopleague.php

Thats the page, with the table on. I will manually update it via a form on an admin panel, to show the new figures after a game. The score is the kills divided by the deaths, so effectively, it is the number of kills you make per time you get killed yourself.

The "exec cp picture" thing is supposedly something needed so that images will display in the table (found on a tutorial), although I am not so sure myself if it is needed, as it is will still display the image in the table, where it says "<img src=images/%s.gif>", because the mysql will insert the first bit of the picture name where the %s is, and therefore it will be read as the standard <img src=blah> html.

Some parts of the script I have no idea what they do, as I have followed a tutorial, modifying bits for my purpose as I go along.

"->
<?
//here is some php
//you can even use this in a loop:
$foo = 0; $max = 20;
while($foo<$max) {
?>
<table> <tr><td>$foo = <?=$foo?>
</tr></tr></table>
<?
$foo++;
//and again some php

}
?> "

You have lost me here slightly, but is that basically a way of displaying the results of a field in a table in a better way than the %s stuff?

Thanks for your help. :)

Options: ReplyQuote


Subject
Written By
Posted
Re: Display sum of table in one line of text?
March 29, 2005 05:29AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.