Jump to content

[SOLVED] Function won't show/work


Mutley

Recommended Posts

I can't get the following function to work, I've tested all the variables and data and they echo correctly, I can't see why it doesn't initiate.

 

<?php

 

function pending($var) {

if($var > 0) {

$result = mysql_query("SELECT 2playerpts, 4playerpts, 6playerpts, 8playerpts FROM leaderboard WHERE user_id = '$var' LIMIT 1");

while($row = mysql_fetch_array( $result ))

{

$pts2 = $row['2playerpts'];

$pts4 = $row['4playerpts'];

$pts6 = $row['6playerpts'];

$pts8 = $row['8playerpts'];

}

echo "<tr><td class='clear'>";

displayRank($var);

userOnline($var);

userProfile($var);

echo "</td><td class='clear'";

echo $pts2;

echo "</td><td class='clear'";

echo $pts4;

echo "</td><td class='clear'";

echo $pts6;

echo "</td><td class='clear'";

echo $pts8;

echo "</td><td class='clear'";

echo $pts2+$pts4+$pts6+$pts8;

echo "</td></tr>";

}

}

 

 

$post_race_id = $_POST['race_id'];

echo $post_race_id;

echo "<<<<<";

$result = mysql_query("p1_id, p2_id, p3_id, p4_id, p5_id, p6_id, p7_id, p8_id FROM races WHERE race_id = $post_race_id");

while($row = mysql_fetch_array( $result ))

{

$p1_id = $row['p1_id'];

$p2_id = $row['p2_id'];

$p3_id = $row['p3_id'];

$p4_id = $row['p4_id'];

$p5_id = $row['p5_id'];

$p6_id = $row['p6_id'];

$p7_id = $row['p7_id'];

$p8_id = $row['p8_id'];

 

pending($p1_id);

pending($p2_id);

pending($p3_id);

pending($p4_id);

pending($p5_id);

pending($p6_id);

pending($p7_id);

pending($p8_id);

}

?>

 

Thanks in advance!

Link to comment
https://forums.phpfreaks.com/topic/128979-solved-function-wont-showwork/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.