Welcome Guest, Not a member yet? Register   Sign In
Was 'how can i tell if a library is loaded' now problems with Flexigrid
#1

[eluser]buckboru[/eluser]
This is a continuation of the mentioned thread.
i found the problem with
$return['record_count'] = $row->record_count;
$return['record_count') was getting a 'Null' even though $row->record_count was populated.

I found that i had to change $row->record_count to $row->RECORD_COUNT
I'm not sure why, exactly but it worked.

So now i'm on to my next problem, and i'm just not having any luck finding the problem.

If i have 1 record in my database, i can get the record to display.
If i add a second record to my database, i get
p>Severity: Notice</p>
<p>Message: Array to string conversion</p>
<p>Filename: libraries/Flexigrid.php</p>
<p>Line Number: 265</p>

Code:
public function json_add_item ($item_data = NULL)
    {
        if ($item_data != NULL)
        {
            $this->json_build .= "{";
            
            //First array index is the ID
            $this->json_build .= "id:'".$item_data[0]."',cell:[";
            
            foreach ($item_data as $key => $value) {
                if ($key != 0)
                {
//line 265        $this->json_build .= "'".addslashes($value)."',";
                }
            }
            $this->json_build = substr($this->json_build,0,-1);
            $this->json_build .= "]},";
        }
        else
        {
            if ($this->post_info['record_count'] > 0)
            {
                $this->json_build = substr($this->json_build,0,-1);
                $this->json_build .= "]}";
            }
        }
    }





/*

database is defined as ID(int), iso(char), name(char), printname(char), iso3(char), numcode(int), actions(char)

Any idea what might be going on here?

Thanks
#2

[eluser]gon[/eluser]
Quote:Any idea what might be going on here?

Thanks

Not really, but you may want to use built-in or external json libraries.




Theme © iAndrew 2016 - Forum software by © MyBB