Jump to content

btherl

Staff Alumni
  • Posts

    3,893
  • Joined

  • Last visited

Everything posted by btherl

  1. I really need more detail to help. Why do you need to monitor the port, and are you able to alter the code of the program which opens the port?
  2. LOL Anyway, if the amount of data is getting out of hand you might want to try a spatial database like postgres with postGIS. I haven't got any experience with those, but the idea is that you just store the spatial location of each place, and the database will calculate the distance for you. Then you only have 5500 data items instead of 5500 x 5500.
  3. I'm a bit confused by your post. What do you mean by "portable" ? Both postgres and mysql allow you to index your data. That means you can ask for particular locations and the database can give you the answer almost instantly. Tab delimited csv files do not allow this, although you already have a form of indexing by splitting them into 37kb files. That may well be good enough for what you need. I think postgres and mysql are much the same when it comes to what you need to do here. There's no significant difference I can think of. It's better though that you have mysql as a requirement than postgres, as mysql is more common. Better still if you use the csv files and have no database required, if you're thinking along those lines
  4. You can use mysqli_num_rows() to see how many rows are in the result, and use that for your if statement. mrfitx, mysqli is "mysql improved"
  5. An ugly workaround would be to do a count() query. Is it related to HAVE_SQL_EXTENDED_FETCH ? You can look in google to find references to that.
  6. I'm pretty sure postgres doesn't have this unfortunately. You could simulate it by creating a temporary table with a unique identifier. But there's no idea of a persistent query which has row numbers associated with it in postgres. There are cursors though .. if your setup allows you to use them (not sure how that would work with multiple page views), then a query using a cursor has specific row numbers for the result.
  7. An example would help a lot. Is it something like this: Table a aid integer adata string Table b bdata string bdata2 string SELECT * FROM a JOIN b ON (adata = bdata) The tables are combined, but there's no obvious unique identifier. Is that the kind of situation you're looking at?
  8. I'm currently working on a system with the following relevant packages: ii php5 5.2.0-8+etch13 server-side, HTML-embedded scripting language ii php5-memcache 2.0.1-1.1 memcache extension module for PHP5 It's a 64 bit system, and apparently suffers from this bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=506827 "When the MEMCACHE_COMPRESSED flag is used during the set() function not only does the compression fail, but memcache fails to store the data. The failure results in no errors or warnings what so ever." Not only this, but memcache additionally automatically compresses items over a certain size, causing failure even if MEMCACHE_COMPRESSED is not set! And furthermore, changing the threshold does not work. I would like to know if anyone has encountered this problem and has found a workaround or solution?
  9. What does the id uniquely identify?
  10. A better database design is having just three columns: class, playername, award. Then if you want multiple awards for a player, you add multiple rows to the table. For example Class Playername Award 1 John Best drinker 1 John Best sarcasm 2 Bob Worst BO Then you don't need to worry about nulls because they're not there. If you really do want to keep your current database structure and detect nulls, you can do this: if ($row['award4'] !== null) { echo $row['award4']; echo "</li>"; echo "<li>"; }
  11. Does it print nothing at all? THere's two possibilities there: 1. There's a fatal error and display_errors is switched off 2. $username or $password is not set, and the query is never executed. What I would do is add "echo $query" after you set $query, to check that the query looks ok.
  12. You can have them connect to the template database, I think it is template0 or template1. It doesn't matter which database you connect to, you just need to connect to one.
  13. Do you want to listen on a port and accept connections (a server)? Or do you want to monitor data on other peoples connection?
  14. Do you want a list of all candidates along with all papers they have applied for?
  15. You can use it like this: SELECT * FROM Skill_ID WHERE Skill_ID IN $sid_list" And the statement should look like this: SELECT * FROM Skill_ID WHERE SKill_ID IN (1,2,3)
  16. Here's one way to do it $sep = '('; $sid_list = ''; foreach ($Skill_ID as $sid) { $sid_list .= "$sep$sid"; $sep = ','; } $sid_list .= ')'; echo $sid_list; Unless I made a mistake in there, you will get a list of ids that you can use in your sql statement.
  17. Hmm.. if you are not specifying a character encoding, perhaps you need to? If you specify the same on both servers it ought to work in the same way.
  18. Another way is to use sessions to remember the last time the user clicked. Then only allow them to click once every 60 seconds (for example). This is simple to implement and effective for most situations. You do need to make sure the user can tell that the reservation was accepted though. Perhaps send them to a list of their reservations if they have their click rejected due to repeats.
  19. Can you post your code? If you can find out as much configuration and version information about both your local host and the remote server, that will help too. Also the operating systems being used.
  20. A simple way to limit recursion is to add an extra argument "depth". That records what depth you are down to in the recursion. Each time you make a recursive call you increase it by 1. Then to cut off the recursion after 2 levels you just say "if ($depth < 2) do recursive call"
  21. You've left out the values of some array elements in the inner array. You're allowed to define constants like this as default values in classes, just not make any function calls or other tricks.
  22. oops, let me think about that..
  23. Well, if you have a form, you must also have a script that accepts values from the form. If you post the code for that I can show you how to modify it to have a default value for quantity.
  24. You can't use php like that .. it can't modify the form after printing it out. But what you can do is have the php script that accepts the form check the quantity, and set it to 1 if it's not set in the form. Edit: Alternatively, you can use javascript to set the value just before the form is submitted.
  25. If you are seeing php in your source, then yes that is a server configuration issue. It means php is not executing. It's likely that it's not executing because you called it test.html instead of test.php, and the server is only configured to recognize php in files that end in ".php"
×
×
  • 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.