ADOdb with Smarty (and an array question throw in to boot!)
| From: | Robert | Date: | Thu, 16 Dec 2004 16:29:25 +0000 |
| Subject: | ADOdb with Smarty (and an array question throw in to boot!) | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-12048@lists.php.net to get a copy of this message | ||
Q1: Is there a faster way of doing this?
while ($data = $rs->FetchRow()) {
$surname[] = $data[0];
$fname[] = $data[1];
$userid[] = $data[2];
$email[] = $data[3];
$profile[] = $data[4];
$position[] = $data[5];
}
Q2: I ran the above using $data[SURNAME] for $data[0] and it runs but I get
"Use of undefined constant" errors in my logs. When I do a "print_r($data)"
my structure looks like this:
Array([0]=>HICKS[SURNAME]=>HICKS[1]=>ROBERT[FIRST_NAME]....)
Do I need to use the arrays position number [0]? I would like to use
[SURNAME] because it is easier to understand when you see the code.
Robert