Welcome Guest, Not a member yet? Register   Sign In
Issue with data return
#3

[eluser]jbads[/eluser]
Thanks for the reply. I have tried you method and got further than I had before.

My view is now displaying the records from the database after also listing characters from the field names and error messages like this
Quote:A PHP Error was encountered

Severity: Notice

Message: Uninitialized string offset: 0

Filename: profile/profile_home_body_view.php

Line Number: 85
Also error for line number 81 and 84
Code:
<?php if(!empty($contacts))
{
    echo '<div class="list_contacts">';
    echo '<ul>';
    //print_r($contacts);
    foreach($contacts as $row){
    
    
        echo '<li>';
        
        if(!empty($row['name']))
        {
            echo '<a href="../profile/view/'.$row['username'].'">'.$row['name'].'</a><br />';
        }
        else
        {
    LINE 81        echo '<a href="../profile/view/'.$row['username'].'">'.$row['username'].'</a><br />';
        }
        
    LINE 84    echo $row['email'].'<br />';
    LINE 85    echo $row['location'];
        
        echo '</li>';
    }    
    echo '</ul>';
    echo '</div>';
}
And if I print_r the code instead of return the data I get this:
Quote:Array ( [id] => 39 [username] => Tester 6 [name] => [email] => [email protected] [location] => Hastings [0] => Array ( [id] => 35 [username] => test2 [name] => [email] => [email protected] [location] => [0] => Array *RECURSION* ) [1] => Array ( [id] => 38 [username] => Test5 [name] => Fucker [email] => [email protected] [location] => Wellington City [0] => Array ( [id] => 35 [username] => test2 [name] => [email] => [email protected] [location] => [0] => Array *RECURSION* ) [1] => Array *RECURSION* ) [2] => Array *RECURSION* )

Any suggestions?


Messages In This Thread
Issue with data return - by El Forum - 06-02-2008, 04:01 PM
Issue with data return - by El Forum - 06-02-2008, 05:14 PM
Issue with data return - by El Forum - 06-02-2008, 11:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB