Search results

  1. M

    reading a txt file with AJAX

    Use JSON as a data-interchange format. In the PHP script, store the variables in an object or array and output the result of json_encode. For example: $foo='bar'; $funcs = array('cos', 'sec', 'tan', 'sin') echo json_encode(compact('foo', 'bam')); To reduce network traffic, make use of the...
  2. M

    MySQL Server for mysql_connect()

    You can also leave off the port number because, when using a hostname of "localhost", the port is immaterial. The PHP MySQL client drivers use a Unix socket (on Unixen) or named pipe (under Windows) when the hostname is "localhost".
  3. M

    perl help

    Use [php], [html] or tags (as appropriate) to format code. As we're not oracles, give us the exact error message ("internal server error" is a generic error from the Apache server and tells us nothing about what's wrong). To get the exact error, check the error log. If you're not already...
  4. M

    Need Help on a Few Things

    Here's an example rewrite of your script to display the tournament table. LocalDB.php defines a class that manages database connections; for example implementations, see "Display all that would be secret while Mysql is broken", "MySQL and PHP", "Redirect when sql server fails". <?php...
  5. M

    Need Help on a Few Things

    When PHP 5.3 is widespread, you can use DateInterval. Until then, you can use Unix timestamps internally. Rather than having separate date and time colums, store both in a single "when" column with type INT. If the dates will never be more than one month in advance (that is, the countdown will...
  6. M

    Need to make my Flash XML Background Fixed

    You left out which browser versions you are testing. For example, the flash displays behind all other elements in Safari 4.1. Since Chrome uses the same layout engine, you're probably using an old version of Safari, and it's probably related to the z-index. Set the z-index to all elements other...
  7. M

    Want to learn to program....

    I'm going to revise my earlier statement about W3Schools to stress that you shouldn't use it: it is at times outdated, incorrect and incomplete. It may have been a passable resource in 2000, when there weren't many options, but not today. Even if you use a visual query builder (which isn't...
  8. M

    Alternate Style Sheets (How do specify a default?)

    Yes, style sheets that aren't specified as alternates are picked by default, no matter whether or not the browser supports alternates. Some browsers simply ignore alternate style sheets. If you want to know what's supposed to happen, go to the standards documents. Read § 14.3.1 of the CSS...
  9. M

    Need to make my Flash XML Background Fixed

    Since it's not actually a background but an element used as a background, you can use fixed positioning, though IE 6 may have problems. What's wrong with that?
  10. M

    Want to learn to program....

    @satishan: that sounds like homework. Also, don't threadjack.
  11. M

    phpMyAdmin - "Wrong username/password. Access denied."

    It's probably from the server move. First, try the suggestion in the thread "Databases MySQL." Then search the support forums for other suggestions. If nothing works, open a support ticket, which will start a thread there, as that's the appropriate forum.
  12. M

    Search AutoSuggest Disable enter key when submit

    At this point, all I can say is it works for me (the "#keywords" was because that's the ID I gave the element in my test page). Try stepping through it with a JS debugger, such as Firebug or Chrome's debugger. Other than that, I'm no oracle. I'd need to see your test page. I did just notice a...
  13. M

    PHP/MySQL Optimizations?

    A good grounding in programming and DB fundamentals is the best way of minimizing resource usage. If you're asking for tutorials and articles (which you'd better be, given the forum), start with § 7.2.1 of the MySQL manual: "Optimizing Queries with EXPLAIN". Also read up on database...
  14. M

    Grouping results from array by page number.

    Though foreach only handles entire arrays, you can combine it with array_slice as you do and you can process a single section of an array just fine. foreach (array_slice($items, $startRow, $rowsPerPage) as $i => $item) { $rowNum = $i+$startRow; ... } Note: the name $maxRows is misleading...
  15. M

    Improved Search Algorythm (Alternative to FULLTEXT)

    To generate a search string for all the keywords: $fullsearch = implode('%', $keywords); However, the order of the keywords is significant. If you don't want this to be the case, you could also generate every permutation of every combination of search terms. You'll have to write a function to...
  16. M

    Search AutoSuggest Disable enter key when submit

    You need to hook the keypress event rather than keyup. There are a few simplifications you can make to the script. For one, you don't need to use attribute selectors for classes, since we have class selectors (e.g. use "li.selected" rather than "li[class='selected']"). The difference between...
  17. M

    Improved Search Algorythm (Alternative to FULLTEXT)

    This is the default limit is imposed by MySQL. Do you mean you also want to search for exact matches of the search string? You're right, when the DB gets too large, performance will be terrible. Since you're only using the DB for persistent storage, the DB isn't used to its full potential...
  18. M

    pin a java application to win7 taskbar

    If SetCurrentProcessExplicitAppUserModelID failed, the next thing I was going to suggest was to check that shell32.dll registered properly, but it sounds like you've got a handle on it.
  19. M

    pin a java application to win7 taskbar

    Were you able to change the application ID?
  20. M

    How to disable php data reporting in x10hosting?

    Try reading my sig and see my first post.
Top