Drupal 6 Custom Code Fix

Completed Posted Oct 30, 2013 Paid on delivery
Completed Paid on delivery

I need a Drupal 6 code fixed ASAP.

The basics behind the custom code are finding a score for a player based off of their fitness test results.

I believe that the problem comes with finding the rank of players in a function (below)

function rankByCriteria($criteria,$uid,$userCriteria,$allnid,$order)

{

$i=1;

$rank=0;

if($userCriteria=='0.00' || $userCriteria=='NULL')

{

$rank=0;

}

else

{

$allTestNids=implode(',',$allnid);

$criteriaRankQry=mysql_query("select * from content_type_test where nid in($allTestNids) and $criteria!='NULL' and $criteria!='0.00' order by $criteria $order")or die('rank by criteria issue');

while($criteriaRankRow=mysql_fetch_array($criteriaRankQry))

{

if($criteriaRankRow['field_player_uid']==$uid and $criteriaRankRow[$criteria]==$userCriteria)

{

$rank=$i;

}

$i++;

}

}

return $rank;

}

Here is what the function is supposed to do

1) Search a table in the database for all records that have the same training_camp_nid, are not empty and are not 0.00

2) Sort the data based on a specified criteria ($criteria) and order ($order)

3) Find the rank of a specific test result based on the current logged in user's ID.

Right now it is not finding this rank correctly. For example a player has a speed result that should rank him 13th but it is ranking him 23rd which is the total amount results found.

Need this fixed right away I have attached the actual file so you can look at it. I am available at all hours to chat. If you feel that he code needs to be completely re-written that is fine I just want it done right and fast.

Drupal MySQL PHP

Project ID: #5078600

About the project

4 proposals Remote project Active Oct 30, 2013

Awarded to:

ErwanMas

Hello , I am a senior in developpment , perl , php javascript . I am a senior in administration of linux systems and sql database . I can help to fix your problem .

$126 USD in 2 days
(6 Reviews)
3.1

4 freelancers are bidding on average $167 for this job

coolguyinus2004

PHP/MYSQL programmer here. the fix for this is not complete rewritten what i will do is check the query and the output it generates and then will ask you wahts correct rank etc then i will see options to get the answer More

$155 USD in 3 days
(286 Reviews)
7.4
drupaldelhi

This is my job. I have 5+ years of experience in drupal. I have worked on drupal 6 and drupal 7 modules. I would like to have access of the site to fix the issue.

$222 USD in 3 days
(45 Reviews)
5.8
pcofilada

Greetings, I can do this for you and I can make this AWESOME. I will also provide 1 month FREE support for this. Thank you and hope to work with you.

$166 USD in 1 day
(0 Reviews)
0.0