Re: what is wrong with my php code?

From: Date: Mon, 03 May 2004 18:28:55 +0000
Subject: Re: what is wrong with my php code?
References: 1 2 3 4 5 6 7 8 9 10 11 12 13 14  Groups: php.general 
Request: Send a blank email to php-general+get-185225@lists.php.net to get a copy of this message
msa wrote:
I am getting back the data....looks like this: Array (
    [0] => Accounting
    [DEPARTMENT] => Accounting
    [1] => Bruce
    [FIRSTNAME] => Bruce
    [2] => fff
    [LASTNAME] => fff
    [3] => 222
    [PHONE] => 222
    [4] => 2
    [ID] => 2
)
In your code below.... <tr> <td width="25%"><?php echo $row_rsArchives['DEPARTMENT']; ?></td> <td width="20%"><?php echo $row_rsArchives['FIRSTNAME']; ?></td> <td width="19%"><?php echo $row_rsArchives['LASTNAME']; ?></td> <td width="36%"><?php echo $row_rsArchives['PHONE']; ?></td> </tr> <?php } else { // Display blank column if they do match ?> <tr> <td width="25%"></td> <td width="20%"><?php echo $row_rsArchives['FIRSTNAME']; ?></td> <td width="19%"><?php echo $row_rsArchives['LASTNAME']; ?></td> <td width="36%"><?php echo $row_rsArchives['PHONE']; ?></td> </tr> Get rid of the 'row_' from your array names, ie <tr> <td width="25%"><?php echo $rsArchives['DEPARTMENT']; ?></td> <td width="20%"><?php echo $rsArchives['FIRSTNAME']; ?></td> <td width="19%"><?php echo $rsArchives['LASTNAME']; ?></td> <td width="36%"><?php echo $rsArchives['PHONE']; ?></td> </tr> <?php } else { // Display blank column if they do match ?> <tr> <td width="25%"></td> <td width="20%"><?php echo $rsArchives['FIRSTNAME']; ?></td> <td width="19%"><?php echo $rsArchives['LASTNAME']; ?></td> <td width="36%"><?php echo $rsArchives['PHONE']; ?></td> </tr> As you're not doing anything with an array called "row_rsArchives". -- John C. Nichel KegWorks.com 716.856.9675 john@kegworks.com

« previous php.general (#185225) next »