Reply to divide-column?

Your name:

Reply:


Posted by "Gustav Wiberg" on 08/29/05 21:50

Hi there!

How do I do a sort in PHP where a column in a db must be two other columns
divided...`?

I tried to use DIV-function in MySQL but it doesn't seem to work ): Of
course, I can hard-code it, but i want this value because of sorting ten
largest of the resultvalue. ($gradeJoke). Ten best jokes I want to get and
ten worst jokes.. .

Some of my code looks like this:

while ($toarray = mysql_fetch_array($querys)) {

$IDJoke = $toarray["IDJoke"];
$titleJoke = $toarray["titleJoke"];
$fromJoke = $toarray["fromJoke"];
$nrOfVotes = $toarray["nrOfVotes"];
$totalValueJoke = $toarray["totalValueJoke"];
$gradeJoke = $toarray["gradeJoke"];

if ($totalValueJoke >0 AND $nrOfVotes > 0) {

$gradeJoke = ($totalValueJoke / $nrOfVotes);

}
else {

$gradeJoke = 0;

}

I want this: $gradeJoke = ($totalValueJoke / $nrOfVotes);

to be integrated in MySQL, is it possible? (I guess it is, but what function
do i USE?)

/G
@varupiraten.se

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация