CodeIgniter Forums
CodeIgniter App getting data from the wrong mySQL table? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: CodeIgniter App getting data from the wrong mySQL table? (/showthread.php?tid=12121)

Pages: 1 2 3


CodeIgniter App getting data from the wrong mySQL table? - El Forum - 10-07-2008

[eluser]xwero[/eluser]
I guess the subject, name and timestamp variables output is blog data, correct?


CodeIgniter App getting data from the wrong mySQL table? - El Forum - 10-07-2008

[eluser]Dave Blencowe[/eluser]
Anything in the comments view is outputting comments, there is a separate view for blog data although the variables are very similar.

main_view.php
Code:
<center>
<table border="0" cellspacing="3" cellpadding="0" width="600px">
  <tr>
    <td colspan="2">&lt;?php echo $title; ?&gt;</td>
  </tr>
  <tr>
    <td rowspan="2">&nbsp;</td>
    <td style="padding-left: 10px;">&lt;?php echo(nl2br($post)); ?&gt;</td>
  </tr>
  <tr>
    <td style="padding-left: 10px;">&lt;?php echo("".$author." - ".$timestamp."");?&gt;</td>
  </tr>
</table>



CodeIgniter App getting data from the wrong mySQL table? - El Forum - 10-08-2008

[eluser]xwero[/eluser]
The variables you add to the blog view are stored so if they are not overwritten by variables passed on to the comments view variables they will be displayed.

But the view for the comments you showed is only for one comment. If you make it a loop the problem should be solved.


CodeIgniter App getting data from the wrong mySQL table? - El Forum - 10-08-2008

[eluser]Dave Blencowe[/eluser]
Made the loop earlier and it works.
Thank you very much for your time and consideration,
Dave