Jump to content

hahaitwork

Members
  • Posts

    98
  • Joined

  • Last visited

hahaitwork's Achievements

Member

Member (2/5)

0

Reputation

  1. Will check those links out Quick update: managed to get the 1,2,3,4,5, etc working.. http://loff-production.com/highscores/avoid-the-cars.html 1. Name. score 2. name. score 3. name score
  2. ah.. i see, well I tried to add that now and got this.. Warning: mysqli::mysqli(): (42000/1044): Access denied for user 'loff_production'@'%' to database 'high_scores_avoidthecars' in /customers/a/3/f/loff-production.com/httpd.www/avoidthecars/highscore.php on line 9 Warning: mysqli::query(): Couldn't fetch mysqli in /customers/a/3/f/loff-production.com/httpd.www/avoidthecars/highscore.php on line 21 Fatal error: Call to a member function fetch_assoc() on a non-object in /customers/a/3/f/loff-production.com/httpd.www/avoidthecars/highscore.php on line 22 Just to update you guys.. It's just the sorting that needs to be done, check out http://forums.phpfreaks.com/topic/271954-loading-only-tables-that-contain-text/ for an update, will close this in a few days. It's easier to follow the other threat
  3. So I tried that "WHERE" thingy.. not 100% where to put it but I thougth and I guessed Behind OR in front of "ORDER by" and got errors hmm.. $result = mysql_query("SELECT name, score FROM high_scores_avoidthecars ORDER BY score DESC WHERE name != '' ");
  4. uh.. really ? ;o I got select under? to select the database if that is the one you are looking for ?
  5. Mind explaining it a little? WHERE name !="? The !="? part I guess it ain't hard to get what it do.. but I don't see the connection about the ! and the " and ?
  6. Sorry, Pretty newbie at this forum.. I searched but didn't find a member with the name "Jessica"?
  7. Okey, my script is working mostly as I want. I need a line that picks top 50, and only choose those who submitted with name, if the name plate is blank.. the score should not come up. Here is the line I guess you have to change: $result = mysql_query("SELECT name, score FROM high_scores_avoidthecars ORDER BY score DESC "); Things that should work: 1. Sort out who got the highest score BUT also who submitted it first (checks highest/lowest id) (The lowest id number is also the one that sumbitted first*) 2. Top 50 scores only 3. Only show scores that have a Name submitted as well. Extra note: I have already a thread that is a bit the same, but will keep both open a little then close the other one. Here is the second thread that will be closed in a few days
  8. ahh.. I just copied what I had to connect.. my bad Will try it again! Here is what I tried, got error on line 22 this time (which is the marked text) Fatal error: Call to a member function fetch_assoc() on a non-object in /customers/a/3/f/loff-production.com/httpd.www/avoidthecars/highscore.php on line 22 <html> <head> <link href="styleofc.css" rel="stylesheet" type="text/css"> </head> <?php $mysqli = new mysqli("x","x","x"); $sql="SELECT @rownum := @rownum + 1 AS Rank , name as Name , score as Score , id as ID FROM high_scores_avoidthecars JOIN (SELECT @rownum := 0) as initialise ORDER BY score DESC, id LIMIT 50"; $res = $mysqli->query($sql); $row = $res->fetch_assoc(); <-------------- LINE 22! <------------------------------- echo "<table border='1'><tr><th>" . join('</th><th>', array_keys($row)) . "</th></tr>\n"; do { echo "<tr><td>" . join('</td><td>', $row) . "</td></tr>\n"; } while ($row = $res->fetch_assoc()) ; echo "</table>\n" ; $res->free(); ?> </html>
  9. Error: Fatal error: Call to a member function query() on a non-object in /customers/a/3/f/loff-production.com/httpd.www/avoidthecars/highscore.php on line 25 Line 25: $res = $mysqli->query($sql);
  10. I do not have a date but I do have "ids" so, the lowest id will be the first that was submitted anyhow. I know how I want it, the problem is i'm not sure how to write the script .. =)
  11. http://loff-production.com/highscores/avoid-the-cars.html Here is what I got at the moment. 1. I need numbers next to the players name (hopefully in a own little table) left of the name. 2. I need them sorted after best score, but ALSO after who submitted first of those with the same score.
  12. Ehm, how come it got so silence? was it because my answer was totally wrong, or because people got unsure about what it could be? if it is a easy edit some how, any idea how I could make it say like ? | 1 | *name* | *score* | | 2 | *name* | *score* | | 3 | *name* | *score* | | 4 | *name* | *score* | That means, somehow add 1-50 on the side of the name and score
  13. Score = int id = int if that is what you mean?
  14. Anymore info you could give me about what you think is wrong ?
×
×
  • 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.