Analog Posted March 23, 2008 Posted March 23, 2008 Re: Free 2 - Gym This should work for version 1...its not tested so let me know You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Fortitude Posted March 23, 2008 Posted March 23, 2008 Re: Free 2 - Gym Thank You kindly for the share Nyna Quote
KDawg08 Posted March 23, 2008 Posted March 23, 2008 Re: Free 2 - Gym Fatal error: Call to undefined function mysql_fetch_single() in /home/teamms/public_html/gym.php on line 126 Twizted ^ That's v1 error. $row['ranks'] = array ( 'strength' => mysql_fetch_single(mysql_query(sprintf("SELECT COUNT(userid) FROM userstats WHERE (strength > %.6f)", $row['strength']))) + 1, 'agility' => mysql_fetch_single(mysql_query(sprintf("SELECT COUNT(userid) FROM userstats WHERE (agility > %.6f)", $row['agility']))) + 1, 'guard' => mysql_fetch_single(mysql_query(sprintf("SELECT COUNT(userid) FROM userstats WHERE (guard > %.6f)", $row['guard']))) + 1, 'labour' => mysql_fetch_single(mysql_query(sprintf("SELECT COUNT(userid) FROM userstats WHERE (labour > %.6f)", $row['labour']))) + 1, 'total' => mysql_fetch_single(mysql_query(sprintf("SELECT COUNT(userid) FROM userstats WHERE (strength + agility + guard + labour > %.6f)", $row['strength'] + $row['agility'] + $row['guard'] + $row['labour']))) + 1, ); I've bolded it for ya to see the error. Quote
Haunted Dawg Posted March 23, 2008 Posted March 23, 2008 Re: Free 2 - Gym This modification is basicly based for v2. Your error will go on and on. until you fix all the mysql_fetch_single. Quote
Analog Posted March 23, 2008 Posted March 23, 2008 Re: Free 2 - Gym Someone with access to v1 & v2 will have to correct the problem. I have never seen how v2 handles queries, or any part of v2 source other than what I've seen on here. I'm going to assume fetch_single is probably a custom function that is in v2 and that is why it does not work. As you are correct, mysql_fetch_single isn't correct, even searched it in the documentation. Quote
Guest Anonymous Posted March 23, 2008 Posted March 23, 2008 Re: Free 2 - Gym Blindly replacing $db-> with mysql_ is the cause of this... I simple search in the PHP manual would have picked this up - there is no mysql_fetch_single function. Extracting the ranks from the database in this way, is really horrible, I dislike the code tremendously, however that is not solving the problem... The code was intended for V2 so the V1 people will have a few issues - but, you have the actual SQL which does work, and you can see the associative array that is being populated. All you need is a simple function: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. (Untested) Quote
Floydian Posted March 24, 2008 Posted March 24, 2008 Re: Free 2 - Gym I would have charged for that one Nyna hehehehehe Perhaps even easier would be swapping out that fetch single with mysql_fetch_row as you have elegantly done in that function which by the way does look to be dummy resistent. :mrgreen: Quote
KDawg08 Posted April 1, 2008 Posted April 1, 2008 Re: Free 2 - Gym LOL I think i love you now LMFAO. j/k Thanks so much, I never thought of that. forgot to look at this: function mysql_fetch_single( $rs ) { if (is_array($row = mysql_fetch_row($rs))) return $row[0]; return false; } Quote
Mafia Empire Posted April 4, 2008 Posted April 4, 2008 Re: Free 2 - Gym ive added the script edited it so it would work with lite but it seems the stats dont go up and the rank is completley wrong can some one please help this is the code gym2.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. gym.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Thanxs in advance for anyone that helps me Quote
Robert Posted April 14, 2008 Posted April 14, 2008 Re: Free 2 - Gym And since I'm feeling in a generous mood... Heres a replacement for the bog-standard gym.php script. Images available from http://nyna.co.uk/gallery/ Installation: 1. Save this script down to gym2.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. 2. Modify your mainmenu.php to add a link to the new gym You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Enjoy (Minor edits to restore original jail functionality - I use a totally different jail system on my test site - sorry 'bout that) Good job Nyna, I will be using this on my game along with a little editing to it. :wink: Thanks. Quote
Danger-Hazard Posted April 14, 2008 Posted April 14, 2008 Re: Free 2 - Gym Very Nice Addition Nyna Its Alot Better Than Mccodes Version And More Effort Has Been Put Into It Well Done :) Quote
-Matt- Posted April 14, 2008 Posted April 14, 2008 Re: Free 2 - Gym No offence Craig but making another account then just posting on the same topic is there any need for that? Quote
Danger-Hazard Posted April 14, 2008 Posted April 14, 2008 Re: Free 2 - Gym *Offence* And I Can't Help Liking What I See -Matt- Quote
Jameoo Posted May 17, 2008 Posted May 17, 2008 Re: Free 2 - Gym i tryed for the past hour to chang the font of the wrighting to white can any 1 do this please thnks Quote
Guest Anonymous Posted May 17, 2008 Posted May 17, 2008 Re: Free 2 - Gym You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Basic CSS - just change the color values - or add color values to suit. Quote
Richard Posted May 22, 2008 Posted May 22, 2008 Re: Free 2 - Gym Converted to v1...Ive renamed to advgym.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Tested and works Thanks for this Nyna! Quote
AlabamaHit Posted May 22, 2008 Posted May 22, 2008 Re: Free 2 - Gym Richard what you need to do is give thanks to Nyna for this NOT DBS....... Taka out that bull crap You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Maybe you should put this You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
Richard Posted May 22, 2008 Posted May 22, 2008 Re: Free 2 - Gym Ive updated the previous post, Thanks for that AlabamaHit Quote
Zero-Affect Posted May 22, 2008 Posted May 22, 2008 Re: Free 2 - Gym Posts: 420 nice number that tez Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.