Group,

Given the following code:


$sql = qq! select * from table where suffix1 > ''!;
        $db_action = $DB->prepare($sql);
        $db_action->execute or die "could not do $sql - $DBI::errstr";
        $rows = $db_action->rows;
        $rec = $db_action->fetchall_arrayref;
        $db_action->finish;

        for ($i=0;$i<$rows;$i++) {
                $id = $rec->[$i][0];
                $first_name = $rec->[$i][1];
                $last_name = $rec->[$i][2];
                $identifier = $rec->[$i][3];
                $prefix1 = $rec->[$i][4];
                $suffix1 = $rec->[$i][5];
                $prefix2 = $rec->[$i][6];
                $suffix2 = $rec->[$i][7];
                $site = $rec->[$i][8];
                $location = $rec->[$i][9];
                $phone_loc_id = $rec->[$i][10];

I would like to find alternate ways to do this that would take into account
changes to the table. For example let's say that the table changes (for
example lets say that site field in the above example is removed).  What I
am interested in, is how are others in the group are handling this type of
thing. I have heard something about tying column names - not sure what this
is.  Any and all suggestions will be most appreciated.

Thanks.


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to