CodeIgniter Forums
Severity: 4096 Message: Object of class CI_DB_mysql_result could not be converted to string - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Severity: 4096 Message: Object of class CI_DB_mysql_result could not be converted to string (/showthread.php?tid=48522)

Pages: 1 2


Severity: 4096 Message: Object of class CI_DB_mysql_result could not be converted to string - El Forum - 01-19-2012

[eluser]kazza[/eluser]
[quote author="CroNiX" date="1327035050"]Now compare that to the other image you are outputting...[/quote]

I changed the other one to how you suggested also Smile still no joy but will keep trying! thanks for the help Smile


Severity: 4096 Message: Object of class CI_DB_mysql_result could not be converted to string - El Forum - 01-19-2012

[eluser]kazza[/eluser]
[quote author="vbsaltydog" date="1327035690"]As you can see in the output of var_dump, your property is empty.

FYI. You have bad code in your method and you are calling sql data in your view file which breaks the MVC design pattern.[/quote]

Code:
<?php echo $sqlquery;

  foreach ($query->result() as $row)
  {
        ?>
            
            <div id="content_l" >
            &lt;?php echo "<img src='$row-&gt;image_lower' />" ?&gt;
            </div>
   &lt;?php
  }
  
   ?&gt;

     &lt;?php echo $sqlquery;

  foreach ($query->result() as $row)
  {
        ?&gt;
            
            <div id="content_r" >
            &lt;?php echo "<img src='$row-&gt;image_lower' />" ?&gt;
            </div>
   &lt;?php
  }
  
   ?&gt;

is this the correct way? still has error msg, and am not sure to change my property?


Severity: 4096 Message: Object of class CI_DB_mysql_result could not be converted to string - El Forum - 01-19-2012

[eluser]kazza[/eluser]
so i removed the
Code:
echo
from the statement and problem solved - oh happy days!! Thanks to all who helped Smile