Jump to content

GRooVeZ

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Everything posted by GRooVeZ

  1. hi i made my very first array, and its working great now i want to have another array wich does the same thing, but on another category, it shows gold silver and bronze logos, but now i want to give leaders of other categorys also those logos, but different ones so i thought i change from $array[$snipergameid][$x] = $sniperleaders[playerid]; (part of the code in a while loop) into $array2[$snipergameid][$x] = $sniperleaders[playerid]; (part of the code in a while loop) and i do the same for the result checker loops but that doesnt work so how do i copy an entire arrray, and give it another name to match it with the correct while loop checker?
  2. and what is that 0 saying?
  3. sorry my bad i changed the var name and forgot to edit before posting its not solving the problem it has to be if ($totalxp > 51) { $maks = $maks - 5; } and yea, i am using while loops while i shouldnt ... thx for showing me how
  4. hi guys when a match is over, two result fields have to be edited the first update goes well but the second one is failing, not allways, sometimes it gives the loser xp, but not the winner (with two players) the script should give the winner 100 xp second 95, third 90,... only the first two controls at the end are working the thirth one is not, and its being used to make the first two so it is doing its job there ... <?php include("./includes/egl_inc.php"); $secure = new secure(); $secure->secureGlobals(); page_protect(); global $config; $matchidcheck = $_SESSION['matchid']; $maks = '100'; $players=mysql_query("SELECT playerid FROM ffa_points WHERE matchid='$matchidcheck' order by killsdeaths DESC"); while(list($playerid)=mysql_fetch_array($players)) { $playerspoints=mysql_query("SELECT points FROM members WHERE id='$playerid'"); while(list($points)=mysql_fetch_row($playerspoints)) { $userpoints = $points; } $newpoints = $userpoints + $maks; mysql_query("UPDATE members SET points = $newpoints WHERE id='$playerid'"); mysql_query("UPDATE ffa_points SET xppoints = $maks WHERE id='$playerid' and matchid='$matchidcheck'"); if ($totalxp > 51) { $maks = $maks - 5; } } $mes="$newpoints $points $maks All Results have been stored succesfully !! Thank You !"; return success($mes,'./ffamatchesarchive.php'); include("$config"); ?> any help would be greatly appreciated THX
  5. hey man i got this thing working now, but to answer ur question im a php noob, and im more like copy pasting and puzzling then writing code myself anyway ive been doing some research and this piece of code is really easy, but im failing ... can u tell me what im doing wrong? i just want to exec a query and then check if there was a result $query10 = "SELECT points FROM ffa_rankings WHERE playerid='$playeridcheck' and gameid='$gametype' and typeid='$matchtype'"; $result10 = mysql_query($query10); $row10 = mysql_fetch_array($result10); if ($row10) { operation here } else { operation here }
  6. hi, i wrote a pointsystem for a league, everything is working good untill i do a certain math action this is the piece of code where it goes wrong $playerkills = '0'; $playerdeaths = '0'; $players3=mysql_query("SELECT playerid,matchid,roundid,kills,deaths FROM ffa_results WHERE playerid='$playeridcheck' and matchid='$matchidcheck'"); while(list($playerid3,$matchid,$roundid,$kills,$deaths)=mysql_fetch_row($players3)) { $playerkills = ($playerkills + $kills); $playerdeaths = ($playerdeaths + $deaths); } $playerkillsdeaths = ($playerkills - $playerdeaths); $matchtypecheck=mysql_query("SELECT type FROM ffa_matches WHERE id='$matchidcheck'"); while(list($type)=mysql_fetch_row($matchtypecheck)) { $matchtype = $type; } $matchskilllvlchecker=mysql_query("SELECT skill FROM ffa_matches WHERE id='$matchidcheck'"); while(list($skill)=mysql_fetch_row($matchskilllvlchecker)) { $matchskill = $skill; } $skilllvlchecker=mysql_query("SELECT ffapoints FROM members WHERE id='$playeridcheck'"); while(list($skill2)=mysql_fetch_row($skilllvlchecker)) { $playerskill = $skill2; } $schaal = round(($playerskill - $matchskill)*7); $playerpoints = ($playerkillsdeaths - $schaal); >>>>>>>>>>>>>>>>>>>>>>> $playerpoints2 = ($playerkillsdeaths - $playerpoints); $insertSite_sql2 = "INSERT INTO ffa_points (matchid,matchtype,playerid,kills,deaths,killsdeaths,points) VALUES ($matchidcheck,$matchtype,$playeridcheck,$playerkills,$playerdeaths,$playerkillsdeaths,$playerpoints2)"; $insertSite2= mysql_query($insertSite_sql2); } everything works good untill the >>>>>>>> line, all math before that is working, i can insert all of those vars in the last field in the points collumn. but from the moment i do playerpoints - playerkillsdeaths it retursn me the $schaal variable, i dont have a clue why, but it does, for some kind of reason i cannot contracts those two vars .. has this something todo with the line before the >>>> line? who can explain this to me? thanks allot in advance
  7. yeah man ! nice thx !
  8. 4f7f567cb7641.jpg4f7f567cb7641.jpg66 INSERT INTO ffa_screens (imgname,match) VALUES( '4f7f567cb7641.jpg', '66' )You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'match) VALUES( '4f7f567cb7641.jpg', '66' )' at line 2
  9. i want the name of a picture stored in my db after i upload it the data is not stored in the db after i run this script, but i dont get errors either i print the two vars before sending them, and they get printed fine any help on this would be greatly appreciated thanks ! <?php error_reporting(E_ALL); ini_set("display_errors", 1); // INCLUDE THE CLASS FILE include('ImageLib.Class.php'); include("./includes/egl_inc.php"); $displayMessage = ''; if($_POST){ if(isset($_FILES['image_file'])){ // SEE THE MAGIC HAPPEN $destination_path = 'uploads/'; $post_file_name = 'image_file'; $width = 600; $height = 400; $scale = false; $trim = true; $uniqueName = true; $img = ImageLib::getInstance()->upload($post_file_name, $destination_path, $uniqueName)->resize($width, $height, $scale, $trim)->save(); $imgstr = mysql_real_escape_string ($img); $fileName = $_FILES['image_file']['name']; $displayMessage = '<div class="image"><img src="'.$destination_path.$fileName.'" /><br />Uploaded And Resized...With new file name : "'.$img.'"</div><br /><br />'; $playerid=$_SESSION['tid']; $matchdetails = mysql_fetch_array(mysql_query("SELECT id FROM ffa_matches WHERE status=2 and admin=$playerid")); $id = $matchdetails[id]; print $img;print $imgstr; print $id; mysql_query(" INSERT INTO ffa_screens (imgname,match) VALUES( '" . mysql_real_escape_string($imgstr) . "', '" . mysql_real_escape_string($id) . "' )"); }} ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>ImageLib Samples By Rahul Kate</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style> body{font-family: arial; font-size:12px; color:#444444; padding:20px;} li{margin-top:10px;} .image{color:green;} .image img{margin-bottom:5px;} </style> </head> <body> <h1>ImageLib | Upload Image, move it to Uploads folder and Resize it and Trim</h1> <?php echo $displayMessage; ?> <form method="post" enctype="multipart/form-data"> Select Image<br /> <input type="file" name="image_file" id="image_file" /> <br /> <br /> <input type="submit" name="submit" value="Submit" /> <br /> <br /> <a href="index.html">Back TO Home</a> </form> </body> </html>
×
×
  • 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.