Jump to content

viion

Members
  • Posts

    47
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

viion's Achievements

Member

Member (2/5)

0

Reputation

  1. Cant edit my post, marking solved as I've found a work around. Thank you for enlightment!
  2. Ah, damn I forgot that. Anyway I can get around it?
  3. I'm having a weird issue going on, I'm wondering if it has to do with my php.ini or server setup, anyway here is the code with the odly outcomes: echo date('Y/m/d H:i:s', 2145000000); // 2037/12/21 01:20:00 echo date('Y/m/d H:i:s', 2149000000); // 1901/12/31 01:58:24 echo date('Y/m/d H:i:s', 2150000000); // 1902/01/11 15:45:04 It seems after year 2037 it goes down to 1900+... Why would this happen? I've tried on 2 godaddy servers and local host and all same result
  4. I'm extremely confused why this is not working. the sql column names are correct, just something is not working, here are the 2 pieces of code, they do not run at the same time on the site infact the working piece i dont even use at the moment, but they're almost identical but the piecei need wont work! I'm using OO sql through mysqli btw. Here is the working code: $query = $db->query("SELECT * FROM countries WHERE value LIKE '$queryString%' LIMIT 10"); if($query) { while ($result = $query->fetch_object()) { echo '<li onClick="fill(\''.$result->value.'\');">'.$result->value.'</li>'; } } else { echo 'ERROR: There was a problem with the query.'; } Here is the piece that doesnt work, which i wish would. $query = $db->query("SELECT gamename, linkuser FROM ogd_projects_main LIMIT 10"); if($query) { while ($result = $query->fetch_object()) { echo $result->gamename; } } else { echo 'ERROR: There was a problem with the query.'; } Anyone notice anything wrong? When the second piece runs, it just stops the render of the page, anything below it will not be considered. Like die();
  5. I finally got this working, my error was a silly typo in another piece of code. Heh, proof reading pays off.
  6. I changed my statement (the == was a typo on here >.<) Removed the Array command in the $user->setList Added public function Still nothing working class items { var $item_list; public function setList($d1) { $this->item_list = $d1; } } $user = new items; $item_list=array("item1", "item2", "item3"); $user->setList($item_list); echo $user->item_list[1];
  7. I have a class setup and I want a var that is in the class to hold an array. This is how it's setup: class items { var $item_list; function setList($d1) { $this->item_list = $d1; } } $user = new items; Then upon loading the website this runs: $item_list==("item1", "item2", "item3"); $user->setList(array($item_list)); when I try pull one of the items though nothing seems to happen. Like this: $user->item_list[1];
  8. the query is very same but it's more like column='$date', column='$otherdata', and so on.
  9. I'm trying to order an event list by dates. What is the best way to go about doing this? I tried setting the field type to "date" but no matter what the value is, it just keeps inputting 00-00-0000
  10. okay thank you, i fixed it, some things in phpadmin had to change
  11. this is my code: function topPoints() { // Pull Array of characters from database. $top_members_b = mysql_query("SELECT ". CHARACTER_CONFIG_PLAYNAME .", ". CHARACTER_CONFIG_POINTS ." FROM ". CHARACTER_DATABASE ." ORDER BY ". CHARACTER_CONFIG_POINTS ." DESC LIMIT 0,10"); if (!$top_members_b) { echo("<div id='error'><img src='img/icons/icon_cross.png'>Characters could not be loaded from database: " . mysql_error() . "</div>"); } // Print Results while ($toplist_b = mysql_fetch_array($top_members_b)) { $top_char_b = $toplist_b[CHARACTER_CONFIG_PLAYNAME]; $top_total_b = $toplist_b[CHARACTER_CONFIG_POINTS]; echo "<strong>$top_total_b</strong> : <a href='?mode=profile&user=$top_char'>$top_char_b</a><br/>"; } } It's result is: 9 9 9 6 6 6 5 3 3 18 Why is it not putting things above 10 to the highest?
  12. How would I do powers in php? Like when you do 5 to the power of 5, it'd return 5x5x5x5x5 Is there a function to do this in php?
  13. The plan to this code is to create a kind of drop down menu depending on the category of the results pulled from SQL. The results would render Distinctively through their numbers. Outputting: 001, 002, 003, etc. Within the while function for them categorys, it'll also do another SQL and pull information from the same table dependant upon the current category it's rendering. This when page renders it'll notice first distinctive category is 000, then within that the second sql will pull all information regarding data in 000, then it'll loop until it finishes. The code generates a number of div's with titles, so when you click them it changes the style of a hidden dive to display:show, everything kinda works great but sometimes when you load the page it doesnt create the <a href link, its like skipping it, and im not sure what could be causing that? Anyone have any idea? The code below: function showResults() { global $possible_choice_array, $users_choice_array; $categorys = mysql_query("SELECT DISTINCT ". MONSTER_DATABASE_MOBCAT ." FROM ". MONSTER_DATABASE ." ORDER BY ". MONSTER_DATABASE_MOBCAT ." ASC"); if (!$categorys) { echo("<div id='error'><img src='img/icons/icon_cross.png'>Could not load items from data base: " . mysql_error() . "</div>"); } while ($cats = mysql_fetch_array($categorys)) { $category = $cats[MONSTER_DATABASE_MOBCAT]; if ($category=="000") { $categorytitle="Miscellaneous"; } if ($category=="001") { $categorytitle="SKY"; } if ($category=="002") { $categorytitle="SEA"; } if ($category=="003") { $categorytitle="DYNAMIS"; } if ($category=="004") { $categorytitle="EINHERJAR"; } if ($category=="005") { $categorytitle="ZNM"; } if ($category=="006") { $categorytitle="KSNM"; } if ($category=="007") { $categorytitle="OMEGA"; } if ($category=="008") { $categorytitle="SALVAGE"; } if ($category=="009") { $categorytitle="ASSAULT"; } // LOOPS ---------------- // THIS CODE SOMETIMES GETS SKIPPED UPON LOADING THE PAGE echo "<a href='#' onclick='categorylist(\"$category\");return false;'>"; // --- echo "<div id='wishlistcategory'>"; echo "<strong>$categorytitle</strong>"; echo "</div>"; echo "</a>"; echo "<div id='$category' style='display:none;'>"; // Possible Choices $possible_choice_sql = mysql_query("SELECT * FROM ". MONSTER_DATABASE ." WHERE ". MONSTER_DATABASE_MOBCAT ."='$category' ORDER BY ". MONSTER_DATABASE_MOBCAT ." ASC"); if (!$possible_choice_sql) { echo("<div id='error'><img src='img/icons/icon_cross.png'>Could not load items from data base: " . mysql_error() . "</div>"); } // Categorys // Print Results while ($possiblelist = mysql_fetch_array($possible_choice_sql)) { // ARRAY FROM POSSIBLE CHOICE SQL $nmID = $possiblelist[MONSTER_DATABASE_MOBID]; $possible_choice = $possiblelist[MONSTER_DATABASE_MOBDROP]; $possible_choice_name = $possiblelist[MONSTER_DATABASE_MOBNAME]; $possible_choice_area = $possiblelist[MONSTER_DATABASE_MOBZONE]; $possible_choice_reqi = $possiblelist[MONSTER_DATABASE_MOBREQI]; $possible_choice_array = explode("|", $possible_choice); // Count the number of values in array. $possible_choice_array_total = count($possible_choice_array); // Adjust Areas so | changes to a comma and a space. $items_needed = str_replace("|", ", ", "$possible_choice_reqi"); // ------------------------------------------------------------------- // Header of Table echo "<div id='wishTable-title'>"; echo "<a href='#' onclick='wishlist(\"nm$nmID\");return false;'><h2>$possible_choice_name</h2></a> <div id='mob-left'><strong>Location: $possible_choice_area</strong></div> <div id='mob-middle'><strong>Requirements:</strong> $items_needed</div> <div id='mob-right'><strong>Total Drops:</strong> $possible_choice_array_total</div> <div style='clear:both;'></div> <ul id='nm$nmID' style='display:none;'> <div id='wishTable-options'>"; showChoices(); echo "<div style='clear:both;'></span>"; echo "</div></ul>"; echo "</div>"; } echo "</div>"; // LOOPS ---------------- } }
  14. You have course year that is linked in as i can see all tables. So you could just make it print out courses that fit within the users course years. Eg courses years 2000-2001-2002-2003-2004, only 2001-2003 will be choosen for people who pick 2001-2003. I am guessing you could do this in sql i actually forgot the command and it could all depending on how course year is structued. If you're saving just say 2007, then you could do: Pull the users information "SELECT * FROM USERS do a while and output the course year into a variable such as $course_year, then in the while do: "SELECT * FROM courses WHERE CourseYear='$course_year'" this will only list courses that are in the year of the time that the student has input. A lot of your post is jumbled up and it's quite hard to understand exactly the purpose and mechanisms you're trying to do, if you're just listing courses it's a lot different than to add check box's and let users save courses or choose them.
  15. For the time issue im guessing you're using mktime() ? Or something to give back the unix. You could do this: function UpdateArcade() { $sql = mysql_query("Select id, game, timedate, name, MAX(score) FROM HighScores Group By game"); while($row = mysql_fetch_array($sql)) { $today = $row['timedate']; $time = $today['month'] . " " . $today['mday'] . ", " . $today['year']; $time .= " " . $today['hours'] . ":" . $today['minutes'] . ":" . $today['seconds']; echo "Game: " . $row['game'] . "<br>"; echo "Score: " . $row['MAX(score)'] . "<br>"; echo "Time: $time <br>"; echo "Name: " . $row['name'] . "<br>"; echo "<p>"; } } Is the max score the highest scored value by certain player? because if you're grouping by game, it's gunna group all that data and pick the Max Score obviously but it'll choose the first name. Maybe you could try. $sql = mysql_query("Select * FROM HighScores ORDER BY score DESC"); This will output like: GAME: UNO - SCORE 1000 - TIME: 12/3/2007 12:13:53 - NAME: Bob. GAME: CROSS - SCORE 800 - TIME: 12/3/2007 12:13:53 - NAME: Peter GAME: UNO - SCORE 710 - TIME: 12/3/2007 12:13:53 - NAME: Bob And so fourth. I don't know if that is specifically what you're after though.
×
×
  • 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.