MySQL Forums
Forum List  »  Newbie

Re: Display sum of table in one line of text?
Posted by: Claude Martin
Date: March 29, 2005 06:12AM

Matthew Jones wrote:
> 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

is this not dynamically generated?
it would help more to have the sql structure and data so i can give you queries that you can use.

> Thats the page, with the table on. I will manually
> update it via a form on an admin panel,

why? why not on demand?

> 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.

so you want to sort by that?
then its easier to do that calculation in sql directly.

>
> 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.

aha. i never do that. i'd do it using echo
but it seems to work.

> 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.

you can always ask php.net

> 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?

yes thats it. i like using ?>some text here<? instead of
echo "some text here"; because you dont have any problems with quotes.
e.g. you have this line:

echo "<a href=\"http://www.google.ch/search?q=web+browser\">click to get better browsers than M\$IE</a>";

you can use:
?><a href="http://www.google.ch/search?q=web+browser">click to get better browsers than M$IE</a><?

thats all. the output is the same.

http://animalliberation.tk http://veganismus.ch
http://maqi.de http://tierrechtskochbuch.de

Options: ReplyQuote


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


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.