Jump to content

artacus

Members
  • Posts

    737
  • Joined

  • Last visited

    Never

Posts posted by artacus

  1. Any Python coders here can appreciate the utility of an interactive shell. A tool that I use regularly is PHP Interactive, a web tool that tries to mimic that functionality. It's especially nice when working w/ php freaks because I can quickly test a piece of code, w/o having to open an editor, save a file, test it in a web page.

     

    http://www.hping.org/phpinteractive/

     

    For writing SQL, my favorite tool is Aqua Data Studio. They make you license the product now, but the previous version was free for personal use. The older version is perfectly functional and you can find it here:

     

    http://download.aquafold.com/download/v4.7.2/

     

    For Javascript/AJAX the FF extension Firebug is invaluable.

     

    So what tools have you found that make your life easier?

  2. 1) easier to read if you use between and you need to quote your dates,

    2) don't store each $bank in its own table, store them all in 1 table with a bank field.

    3) Can't use HAVING unless there is a group by clause,

     

    SELECT *
    FROM banks
    WHERE bank_name = '$bank' AND username = '$username'
    AND date_stamp BETWEEN '$to' AND '$from'
    ORDER BY $order DESC
    

  3. My tables would probably look something like this:

    - categories (id, parent_id, description, sort_order)

    - items (id, cat_id, description, size_id, material_id, color_id, ...)

    - sizes

    - inventory

     

    Using that approach you can comfortably nest categories 3 levels deep. (Shirts->Dress->Long Sleeve). If you feel you need to go more than 3 levels deep, then I'd suggest a different approach. But I kinda doubt you'll need to.

  4. mysql_query only gives you a result set. You need to use mysql_fetch_assoc() or something similar to get the info out of that result set.

     

    Conversely, you could just write it into 1 query.

    INSERT INTO enrollment (UID, CID) 
    SELECT UID, '$course' FROM users WHERE username = '$username'

  5. It WILL update only 4 records.  But there is no guarantee that it will be the 4 that you expect. You should get 1 - 4 using an autoinc id. But if you were using something else (last name), it would update the first 4 that it came across and not in A-Z order. You are better off specifying exactly what you want to update instead of relying on LIMIT

×
×
  • 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.