Welcome Guest, Not a member yet? Register   Sign In
Queried Links
#1

[eluser]Bl4cKWid0w[/eluser]
I am having some trouble with the anchor function. I have loaded the function in my main.php controller and am using the link in my main_view.php view. My links are stored in my database so I use a query to gather the information. I have a table for link "categories" and then another table for the actual links which contain a row that says which category they go under. I use the following code in my main_view file to gather the information:

Code:
<?php
             $this->load->helper('url');
            
             foreach($navquery->result()as $row){
                     echo "$row->categoryName<br>";
                        $query = $this->db->query("SELECT * FROM navlinks WHERE categoryID = '".$row->categoryID."'");
                        foreach($query->result() as $link){
                            $link = anchor($link->linkDesination, $link->linkName);
                                  echo "<li>$link</li>";
                        }
                        
                }
                        
            ?&gt;

The link itself displays fine, except for the fact that there's a huge error message above each of the links. This is the error that I am getting:

Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined property: stdClass::$linkDesination

Filename: views/main_view.php

Line Number: 27

Anyone have any ideas?
#2

[eluser]jcopling[/eluser]
Sorry to state the obvious first, but is there a field called linkDestination in that table? And if there is, does the generated URL display the expected result?




Theme © iAndrew 2016 - Forum software by © MyBB