For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > December 2004 > ADOdb with Smarty (and an array question throw in to boot!)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author ADOdb with Smarty (and an array question throw in to boot!)
Robert

2004-12-16, 8:58 pm

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com