[eluser]Ivar89[/eluser]
Ok, stupid thing here
, I know how to select Data from database and post it on a page
but When I try to select the date and refere it to a value for a textfield something goes wrong.
controller;
Code:
function edit($id)
{
$data['ID_Blog'] = $id;
$this->db->where('ID_Blog', $id);
$data['blogs'] = $this->db->select('strBlogTitle, ID_Blog, ID_Language, datPublicationDate, memBlogContent, strBlogKeyword, strBlogDescription, blnPublished, strAuthorName, memBlogIntro,')->get('tblblog')->result();
$this->load->view('blog/edit', $data);
}
View;
Code:
<?php echo form_open('blog/save'); ?>
<?php foreach ($blogs as $blog): ?>
<p id="titleshow"><b>Blog Title:</b></p>
<input class="content" id="title" name="strBlogTitle" value="<?php echo $blog->strBlogTitle; ?>" style="display:none;" type="textfield">
<p id="intro"><b>Blog Intro:</b></p>
<textarea class="content" id="content0" name="memBlogIntro" value="<?php echo $blog->memBlogIntro; ?>" style="width:600px; height:100px; display:none;"></textarea>
It might be a problem that I use $data['ID_Blog'] and $data['blogs'], but not sure
I need the ['ID_Blog'] to update the right row in database..
Weird thing(weird to me);
I DO get the strBlogTitle to show in the textbox but not the memBlogIntro(And the rest of the view code, but thats not relevant) only the first one works:S
any suggestions?
ps: I checked for type's and capitals and they are all correct.