Welcome Guest, Not a member yet? Register   Sign In
Display images from uploads folder using database
#4

[eluser]Rodrigo Graça[/eluser]
You can't use "$row" like that:
In your case i think that is: "records" that you use


First i have this on my controller:

Code:
$this->load->model("configs_model");

$data["rows"] = $this->configs_model->getConfigs();
                
$this->load->view("select", $data);


And on my view i have a loop to show all images:

Code:
<?
foreach($rows as $row)
     {
    ?>
    <tr id="&lt;?=$row-&gt;id?&gt;">

                                        <td>&lt;?=$row->id?&gt;</td>
                                        
                                        
                                        <td>&lt;?=$row->file_name?&gt;</td>
                                        
                                        <td>
                                            &lt;?
                                            $arrayData = explode(".", $row->file_name);
                                            
                                            if( $arrayData[1]=="swf"){
                                                ?&gt;
                                                <img src="&lt;?=base_url()?&gt;assets/images/swf.png" border="0" title="SWF" alt="SWF" width="75" height="75">
                                                &lt;?
                                            }
                                            else {
                                                ?&gt;
                                                <img src="&lt;?=base_url()?&gt;assets/uploads/&lt;?=$row-&gt;file_name?&gt;" border="0" title="&lt;?=$row-&gt;file_name?&gt;" alt="&lt;?=$row-&gt;file_name?&gt;" width="75" height="75">
                                                &lt;?
                                            }
                                            ?&gt;
                                        </td>
    </tr>
    &lt;?
    } ?&gt;


Messages In This Thread
Display images from uploads folder using database - by El Forum - 05-21-2012, 03:26 AM
Display images from uploads folder using database - by El Forum - 05-21-2012, 03:34 AM
Display images from uploads folder using database - by El Forum - 05-21-2012, 03:47 AM
Display images from uploads folder using database - by El Forum - 05-21-2012, 04:09 AM
Display images from uploads folder using database - by El Forum - 05-21-2012, 04:26 AM
Display images from uploads folder using database - by El Forum - 05-21-2012, 05:20 AM
Display images from uploads folder using database - by El Forum - 05-23-2012, 01:47 AM
Display images from uploads folder using database - by El Forum - 05-26-2012, 12:27 PM
Display images from uploads folder using database - by El Forum - 09-22-2012, 07:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB