holy crap @ adodb

    Date: 11/11/06 (PHP Community)    Keywords: mysql, technology, sql

    i'm just starting to learn the beauty of adodb. freaking hella saved lines of unnecessarily repeated code.

    $sql = "SELECT * FROM $dbname.accounts WHERE id = '".$_COOKIE["account_id"]."'";
    $result = $__db->Execute($sql);
    $account_name = $result->fields["name"];
    $account_prestige = $result->fields["prestige"];
    $account_rank = $result->fields["rank"];
    $account_kills = $result->fields["kills"];

    replaced:

    $account_query = "SELECT * FROM $dbname.accounts WHERE id = '".$_COOKIE["account_id"]."'";
    $account_result = mysql_query($account_query, $connection) or die("Error getting account data: [" . mysql_error() . "]");
    $account_row = mysql_fetch_array($account_result);
    $account_name = $account_row["name"];
    $account_prestige = $account_row["prestige"];
    $account_rank = $account_row["rank"];
    $account_kills = $account_row["kills"];

    horray for coding technology! time to dance!

    Source: http://community.livejournal.com/php/509542.html

« w2box or something like it || array to xml »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home