Search results

  1. M

    Suggestions for best way to build a MySQL table from raw data?

    Programmatically controlling the console (mouse & keyboard) is okay when you're testing a UI, but is too brittle for other purposes. Layout changes, even changing the position of a widget by half of a dimension (width, height), will break your app. Better approach: use java.net.URLConnection to...
  2. M

    SQL Query Problem

    Error messages from mysql_error() are going to be too technical and potentially contain sensitive information. They won't contain information the average user can use, and may contain information a malicious user can use. If you need to see the full error, log it with error_log() so that only a...
  3. M

    SQL Command Line

    No, but you can use phpMySQLAdmin, which is available through cPanel.
  4. M

    Programming your own forum

    You'll have to store data somehow. You don't have to use a relational database (an object database is an alternative), and you don't need to use a DBMS that uses SQL, but you don't want to write you own DBMS. For one thing, it will take awhile to implement all the functionality. For another...
  5. M

    MySQL Format

    Have you heard the good news? The words are SHOW CREATE TABLE, and they show Bob's love for you. Not so different from the standard, which every DBMS deviates from noticeably. For MySQL, I always head over to the MySQL reference manual.
  6. M

    strange error messages in log

    mod_fcgid is a FastCGI Apache server extension. From the looks of it, those are debug messages rather than error messages. They just say that mod_fcgid used /usr/local/cpanel/cgi-sys/php5 to interpret your PHP scripts.
  7. M

    a:active long URL problem

    The :active class isn't dependent on the value of element attributes, including linked URIs. The attribute value would matter only if you were using an attribute selector, such as [href^=/forums] or [href$=id=1] (note: using "^=" and "$=" in attribute selectors is CSS3). In short, just use...
  8. M

    MySQL Format

    For MyISAM tables, MySQL ignores FOREIGN KEY constraints rather than considering them errors. The real cause is that MySQL just doesn't support that syntax, which is an extension to the SQL standard. Why didn't the MySQL developers add support for both? I'm not sure, but it's probably because...
  9. M

    How to INSERT 1 form answer to multiple table results.

    Did you sanitize the values you insert using (e.g.) mysql_escape_string or one of the filter functions? You don't want to leave your script open to SQL injection $validKeys=array( 'year'=>0, 'month' => 0, 'day' =>0, 'hour' => 0, 'name' => 0, 'description' => 0, ... ); $row =...
  10. M

    Does Anyone Know SQL

    Or even SQL standards and extensions. The INTO clause isn't even standard. To be fair, SQL support in DBMSs is worse than browser support for web standards; it's tricky to the point of being pointless to cover all the whys and wherefores. You can rollback the transaction, it's just that that...
  11. M

    Does Anyone Know SQL

    The SELECT in INSERT ... SELECT isn't exactly a subquery, so I didn't bother. MySQL doesn't support SELECT ... INTO. Both SELECT ... INTO and INSERT ... SELECT require a search and an insert, and will thus perform similarly. A ROLLBACK is only sent to discard the changes introduced by a...
  12. M

    Does Anyone Know SQL

    It can be done in two by using INSERT ... SELECT followed by DELETE, but (as you surmise) not one. This looks like it needs transactions to prevent duplicates in the tables if the DELETE fails to execute. START TRANSACTION; INSERT INTO target SELECT * FROM source ORDER BY col DESC LIMIT...
  13. M

    PHP MySQL communication basics

    Your choice of primary key doesn't affect which other columns to index (indices on other columns are sometimes called "secondary indices"). You can use the username column as the primary key and index the other columns for performance. You can create secondary indices when you create the...
  14. M

    AJAX bookmarking/forward/back

    The Really Simply History library that xav0989 linked to is a better solution (modulo the lack of Safari support), but if you want to know a fix for your code, take a closer look at my last post. Both my previous posts, actually, for the first describes another serious bug that still needs to be...
  15. M

    PHP MySQL communication basics

    Adding a little: Setting up a PHP page as executable is not only useless, it's harmful. The execute permission lets you use the name of a file as a command name, though the system still needs to figure out how to execute the file, which involves looking for magic numbers. For scripts, the magic...
  16. M

    CrossSlide Installation Help

    Check the page source and (as it says) read over the jQuery docs to learn how to use it, especially jQuery Core.
  17. M

    AJAX bookmarking/forward/back

    Another problem is that the script that loads content based on the fragment identifier: if ((window.location.href.split("#", 2)[1] == null) || (window.location.href.split("#", 2)[1] == "") || (window.location.href.split("#", 2)[1] == "index")) { sendRequest("../index2.php"); } else {...
  18. M

    when installing a script geting - E_CORE_NOTICE - ????

    I thought it was documented behavior, but I can't find a reference in the PHP docs. It sure as hell is documented for Perl ("Programming Perl", 3rd ed., p860). It may have been in the documentation around 2006, when Ben Ramsey references it. Edit: The bit that Ben Ramsey quotes includes a...
  19. M

    when installing a script geting - E_CORE_NOTICE - ????

    Quoting errors is helpful, but it's still damn hard to fix them without knowing the source that generated it. Always give enough information to properly diagnose the issue. If it's a custom script, post a minimal test case that generates the error. If you're using a library, say which library...
  20. M

    PHP MySQL communication basics

    You presume correctly. Many FTP clients will also let you set file permissions. It's covered by the section on numeric permissions. Mode 0600 means only the file owner has read & write access. This prevents other users from reading the source and discovering you password. On X10 (and other...
Top