MySQL Error
Moderator: General Moderators
http://www.krunkdesigns.com/gtthing/gtthing2.php
enter wut ever you want and tell me if it works for you
enter wut ever you want and tell me if it works for you
oh yeah go to http://www.krunkdesigns.com/gtthing/gtthing4.php after you fill it out
top 10? or just 10 rows?
top 10 would look like:
and to claifiy, points/whatever is whatever it is your basing your info on to arrange from lowest -> highest
top 10 would look like:
Code: Select all
<?php
$sql = "SELECT * FROM table_name ORDER BY points/whatever DESC LIMIT 10";
// if you want just 10
$sql = "SELECT * FROM table_name LIMIT 10";
?>but i want it to be from highest to lowest would that be
or how ever you do accending
Code: Select all
<?php
$sql = "SELECT * FROM table_name ORDER BY points/whatever ACEN LIMIT 10";
?>Code: Select all
<?php
$db = mysql_connect("localhost", "krunk_gtstat", "gtstat");
mysql_select_db("krunk_gtstat",$db);
$result = mysql_query("SELECT * FROM stat ORDER BY percent ASC LIMIT 10",$db);
printf("Username: %s<br>\n", mysql_result($result,0,"username"));
printf("Percentage: %s<br>\n", mysql_result($result,0,"percent"));
?>http://www.krunkdesigns.com/gtthing/gtthing3.php
-
coreycollins
- Forum Commoner
- Posts: 67
- Joined: Sun Feb 01, 2004 1:04 pm
- Location: Michigan
lol...
you need a loop function so it displays all data in the db.
I assume you didnt bother looking at the tutorial I gave you huh? Cause most of your questions would already been answered.
heh
http://us4.php.net/manual/en/control-st ... .while.php
you need a loop function so it displays all data in the db.
I assume you didnt bother looking at the tutorial I gave you huh? Cause most of your questions would already been answered.
heh
http://us4.php.net/manual/en/control-st ... .while.php
-
coreycollins
- Forum Commoner
- Posts: 67
- Joined: Sun Feb 01, 2004 1:04 pm
- Location: Michigan
http://hotwired.lycos.com/webmonkey/99/21/index4a.html
I would suggest look thought google for tips for all of this too and purchasing a decent PHP and mySQL book.
I would suggest look thought google for tips for all of this too and purchasing a decent PHP and mySQL book.
-
coreycollins
- Forum Commoner
- Posts: 67
- Joined: Sun Feb 01, 2004 1:04 pm
- Location: Michigan
ok this is wut i got
but it just keeps looping and never stops, did i miss something?
for an example got to
http://www.krunkdesigns.com/gtthing/gtthing3.php
Code: Select all
<?php
$db = mysql_connect("localhost", "krunk_gtstat", "gtstat");
mysql_select_db("krunk_gtstat",$db);
$result = mysql_query("SELECT * FROM stat",$db);
while ($myrow = mysql_fetch_row($result)) {
printf("Username: %s<br>\n", mysql_result($result,0,"username"));
printf("Percentage: %s<br>\n", mysql_result($result,0,"percent"));
}
echo "\n";
?>for an example got to
http://www.krunkdesigns.com/gtthing/gtthing3.php