Re: [PHP][Help] Ranking Page
Quote:
Originally Posted by
s-p-n
Eh, mine is way more multi-compatible, and sometimes gives more intuitive results.
We weren't trying to get rid of you.. Well I wasn't.. I think some people trying to help you aren't helping anything.. Also, I think you should get better at PHP.
If you choose to take it as an insult, that's fine. Don't leave because of us though. Again, we're only trying to help improve your skills- with constructive criticism. People should pay for this stuff! :thumbup1:
I'm not leaving because of you. I got helpful anwers from you, which hepled me. Suddendly just this guy called jMerliN came here and started flaming on me. I may not be the best PHP coder, but what can I do? Learn some PHP, which I am trying to do.
Anyway, I think that PHP is not my thing, I'll probably leave it for a while, and start doing things with HTML which I know more than PHP.
So thanks for people who helped me on this. I got helpful answers from you, and this script started getting better and better, as it works now as I wanted it to work.
Re: [PHP][Help] Ranking Page
Make a Array >_>"
PHP Code:
<?
echo "<table width=\"100%\">";
echo "<tr>";
echo "<td>Rank</td>";
echo "<td>Name</td>";
echo "<td>Job</td>";
echo "</tr>";
$jobs = array('200' => 'Jobhere', '210' => 'OtherJob');
$count = 1;
$sql = mysql_query("SELECT * FROM `character` ORDER BY EXP DESC LIMIT 25");
while($row = mysql_fetch_array($sql)){
echo "<tr>";
echo "<td>".$count."</td>";
echo "<td>".$row['Name']."</td>";
echo "<td>".$jobs[$row['Job']]."</td>";
echo "</tr>";
$count++;
}
echo "</table>";
?>
Just fast writing and from scratch.
idk the jobs, tables, etc..
Hope its clear
Will output like this ;
Rank Name Job
1 Sayuta JobHere
2 Counterweight OtherJob
Re: [PHP][Help] Ranking Page
Quote:
Originally Posted by
sayuta
Just fast writing and from scratch.
idk the jobs, tables, etc..
You gave the same answer as 10 other people..
You and everyone else.. Learn PHP & SQL.. Better yet, learn good programming practices :rolleyes:
It's not easy. Learn the difference between quotes & apostrophes, when to use which, and why. Learn to indent properly, or in a fashion in which others can read through. Limit the amount of functions when possible; If you have repeating echo statements, compact it into a single one, and white-space is your friend. Also, try to anticipate the formatting of your HTML. You want to be able to read it both in your PHP code, and in the source code of the browser.
Start by reading this article.
:thumbup1: