Jump to content

Phpfr3ak

Members
  • Posts

    110
  • Joined

  • Last visited

    Never

Everything posted by Phpfr3ak

  1. Thanks man, worked great!!!
  2. Probably real basic but im nto great with the maths aspect of php, how would i get the $level + noto to show from the php below as currently i get, From: System 4 minutes ago You have reached level 1 + 1 in Notoriety, Please check the Skill Points section to see if you now qualify for any upgrades! $sql="INSERT INTO messages (to_username,from_username,message,type, timestamp) VALUES('$playerdata[username]','System','You have reached level $level + 1 in Notoriety, Please check the Skill Points section to see if you now qualify for any upgrades!','Player', NOW())"; mysql_query($sql) or die(mysql_error());
  3. Sorry its rather difficult for me to explain. I'll try the best i can; cash_Stole currently <?php $sql = "SELECT id, username, score, class, Banned FROM users WHERE is_active = 1 ORDER BY $ReportType DESC LIMIT 25"; $query = mysql_query($sql) or die(mysql_error()); $i=0; while($users = mysql_fetch_array($query)) { $i++; ?> successfully ranks the players in the database in order of who has most of what. e.g http://urlhere.com//top.php?ReportType=cash_Stolen This will currently who has the highest cash_stolen colum in the database. Id like to then echo what the actual number is... if this makes sense but the report types vary, yet are defined e.g e.g http://urlhere.com//top.php?ReportType=cash_Stolen orders by most cash stolen e.g http://urlhere.com//top.php?ReportType=score orders by score This currently works with the actual ranking in the php code i showed above. but id like to change <?php echo $users['score']; ?> to something that would echo the actual users information from the database for that area using $ReportType. If this makes sense to you.
  4. Sorry it actually does work upon closer inspection... well ranks the players as ordered in each area. The only issue i have now is with the whole <?php echo $users['score'] ?> area as how would i make it echo the $ReportType, instead of score the $reporttype is already defined.
  5. 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 'DESC LIMIT 25' at line 1 If i sort by score it works... and shows the top 50 players, thats the section i changed. I'm wanting to vary it by $ReportType
  6. Hi any clues as to why this doesn't work, probably real simple having a slow day. <?php $ReportType = mysql_real_escape_string($_GET['ReportType']); $sql = "SELECT id, username, score, class, Banned FROM users WHERE is_active = 1 ORDER BY $ReportType DESC LIMIT 25"; $query = mysql_query($sql) or die(mysql_error()); $i=0; while($users = mysql_fetch_array($query)) { $i++; ?>
  7. Thanks very much got it in 1! Learnt something new also ty
  8. Howdy Fairly new to the whole php scene made some php code which works, but i get the error Notice: Use of undefined constant Yes - assumed 'Yes' in C:\Program Files\EasyPHP-5.3.3\www\htdocs\top.php on line 26, line 26 is the first line code, kind of lost and would appreciate an explanation on how to fix this if possible thanks! <?php if ($players['Banned'] == Yes){ echo $players['name'] ?> (BANNED) <?php } else {?> <a href="profile.php?id=<?php echo $players['id'] ?>"><?php echo $players['name'] ?>
×
×
  • 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.