Jump to content

premiso

Members
  • Posts

    6,951
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by premiso

  1. mysql_fetch_assoc look at the examples. Since you grab the first row with the first line of that function, the do while will run with that first row, then each successing loop will iterate through the rows. That code there will work, guaranteed by me. If it is how you want it coded is another issue.
  2. lol it was my "baby" project, I have to pamper it. That and I get my funds from other sources, so it is not really an issue. It would just be nice for a couple to do a donation here and there. Oh well.... :cries: and now I am done
  3. I think I spotted the issue: public function fetchArray() { $this->fetchArray = mysql_fetch_assoc($this->query); if (!$this->fetchArray) Throw New Exception(mysql_error()); else { $array = array(); // this will not work. while ($field = $this->fetchArray) do { $array[] = $this->fetchArray; }while ($this->fetchArray = mysql_fetch_assoc($this->query)); // this should. return $array; } } Although I am not sure which way you want it, but your logic is flawed there. The problem was an infinite loop.
  4. Open up your php.ini look for "memory_limit" change that to be a higher number, restart apache and see if that works.
  5. Why make text-based games, when making a game like WoW will bring you in what, 10 million users at around $100 per user just to get started then $15 a month per user.... Now we are talking some serious money! But back on track to the OP: I never ran an online game, honestly, in my opinion it is dumb. Not worth the effort and if your game does not offer anyone anything special, it will go no where. Do not feel bad. To relate, I do run a website for an ad-free and free (blog hosting) and it has been online with no ads for about 6 or 7 years now, it gets frustrating that when I do ask for a donation from my 6k users no one donates a cent. But it is active, not hugely active and it pulls in about 40k "unique" hits a day. Which is great, I could sell out and throw ads on everyone's blog, but not worth it. Instead I just create a site that makes money and eventually I will develop the free blog site to have "pro" features that people can upgrade to. I consider it still in "beta" still cause I really have not developed anything since 2006. So once I get a new version out with more bells and whistles and start my SEO program up again, hopefully it will start bringing in money from people who want the "Pro" features. So in all honestly, you can give up if you are that frustrated. But for the type of website you are running, where there are only a handful out there that people actually play regularly. I would say either figure out a unique feature that grabs peoples attentions, or put your energy to a site that people actually want to do. Think of a new idea for a site, and run with it. Hope all goes well for you. EDIT: Regarding the money part, I saw that you no-where stated funding and you just wanted people to play. But the same goes, make something unique and fun that is different and people will tend to want to play
  6. You can use json_encode as far as how to use that I do not know. But I know it is common practice, especially with AJAX scripts.
  7. echo "<div id=\"{$row['arena']}\">"; Should take care of you.
  8. Yes you can, as asp should know how to handle "REQUEST" data.
  9. It maybe for a linux distro, but versions before 5.3 did not have the right functionality of that function for windows, unfortunately. function win_checkdnsrr($host, $type='MX') { if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') { return; } if (empty($host)) { return; } $types=array('A', 'MX', 'NS', 'SOA', 'PTR', 'CNAME', 'AAAA', 'A6', 'SRV', 'NAPTR', 'TXT', 'ANY'); if (!in_array($type,$types)) { user_error("checkdnsrr() Type '$type' not supported", E_USER_WARNING); return; } @exec('nslookup -type='.$type.' '.escapeshellcmd($host), $output); foreach($output as $line){ if (preg_match('/^'.$host.'/',$line)) { return true; } } } There is some code you can use in place of checkdnsrr for Windows.
  10. $name = basename($_FILES['userfile']['name']); if (file_exists('../schedules/' . $name) && stristr($name, ".HTML")) { $ext = explode(".", $name); $name = str_replace($ext[1], 'HTM', $name); } $final_file_name = '../schedules/' . $name; That should take care of that.
  11. die('You didn\'t fill in a required field'); Single quote was not escaped.
  12. Your code is not dishing out arrays when it is expected to. If you use is_array before trying to loop using foreach or calling array_keys it will spare you those error messages.
  13. You can use json_encode/json_decode if ASP as code for that. Basically that serializes an array for ajax usage. See if ASP supports json_decode or if you can find code to do that. If so that would be my suggestion either POST the json_encode version or send it via GET.
  14. You were missing a ; after mysql_close in the original code. Since I removed that line it took out that error.
  15. In the revised code I posted that is done. I added functionality to the select(). But if you call connect() it does it automatically. However if you want to change the DB at any time you just call $connection->select('newdbhere'); Look over my revision to see the changes. $connection = new mysql('localhost', 'root', '', 'cms'); $query = "SELECT ID, Username, Password, Email FROM admins"; $connection->query($query); Should work, given the code I modified above.
  16. A few changes: # cat insert.php <?php $food = $_POST['food']; $points = $_POST['points']; // Make a MySQL Connection $con = mysql_connect("localhost", "root", "pass") or die('Could not connect: ' . mysql_error()); mysql_select_db("watchers", $con); // Insert a row of information into the table "example" #$sql="INSERT INTO Meal (food, points) VALUES ('$_POST[food]','$_POST[points]')"; $sql="INSERT INTO Meal (food, points) VALUES ('$food','$points')"; // second param is not necessary mysql_query($sql) or die(die('SQL Was: ' . $sql . "\nError: " . mysql_error()); echo "1 record added"; // not needed mysql_close($con); ?> See what that does for you.
  17. setcookie("pi", false); And wow I cannot believe that works...crazy stuff.
  18. Post it in the Freelance[/m] section, not here.
  19. <?php $string = 'http://anywhere.com/x/bw/bbbb/vid?lot=6874699'; $string = explode('lot=', $string); $string = $string[1]; echo $string; ?>
  20. Remove the slashes around the ' they are not needed and are causing the error.
  21. Localhost or via an online webserver? Try setting it to 2 days ago and see if that works. Timezones can have this effect of not killing the cookie. If that fails setcookie use the path and domain parameters when setting and destroying the cookie.
  22. For the id newly created mysql_insert_id should do the trick.
  23. Right, but you were using the $connection->select and trying to pass a parameter that way, which it does not accept a parameter.
  24. You do realize you cannot put a function in a string and expect it to be called. Try this: $search_query = 'select * from Students where'; if(($keyword !='Any') || ($keyword !='')) { $search_query .="NickName LIKE \'%$keyword%\' or DescriptionMe Like \'%$keyword%\'"; } if(($professional !='Any') || ($professional !='')) { $search_query .="AND Current_Pro = \'$profession\'"; } if(($city !='Any') || ($city !='')) { $search_query .="AND City = \'$city\'"; } if(($state !='Any') || ($state !='')) { $search_query .="AND State = \'$state\'"; } if($country !='Any') { $search_query .="AND Country = \'$country\'"; } $search_query .= 'ORDER BY `Students`.`NickName` ASC'; $result = mysql_query($search_query) or die(mysql_error()); while ($row = mysql_fetch_assoc($result)) { print_r($row); } And see if that works for you.
  25. What does site B support?
×
×
  • 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.