[eluser]Kyle123[/eluser]
Hi All,
I'm just getting started with CI and right about now I feel like throwing my computer out of the window
I'm running a development LAMP stack (turnkey) on a virtual machine and using MSSQL 2008 for the back end database.
I have a basic set-up (with a customised controller class that works perfectly) comprising of the following:
Model:
Code:
<?
class shouts_model extends CI_Model {
public function __construct()
{
$this->load->database();
}
public function get_newest() {
$sql = "Exec sp_wallboard_topShouts";
$query = $this->db->query($sql);
return $query->result();
}
Controller:
Code:
<?php
class Shoutboard extends MY_Controller {
public function __construct()
{
parent::__construct();
$this->load->model('shouts_model');
}
public function index(){
$this->title = "Shout! Board";
$this->keywords = "Shout Reporting";
$this->javascript['page'] = "wallboard.js";
$this->css['shout'] = "shoutboard.css";
$this->data['top_shouts'] = $this->shouts_model->get_newest();
$this->_render('pages/shoutboard');
}
}
View:
Code:
<ul>
<? echo $top_shouts; ?>
<? foreach($top_shouts as $row): ?>
<li>
<div class="postit">
<span class="label">To: <? echo $row->from ?></span>
<span class="label">From: <? echo $row->sent ?></span>
<p class="message"><? echo $row->note ?></p>
</div>
</li>
<? endforeach; ?>
</ul>
when the execution hits this line (as far as I can tell):
Code:
$query = $this->db->query($sql);
The server closes the connection and returns no data (error 324 in chrome, but I also get it in IE) and no error is displayed or in the logs.
All the rest of my code executes properly and this is the first issue that I've run into that's stumped me, at first I thought it was the recordset being returned by the database, but it is very simple and nothing special, 3 text fields and a date.
Any help/pointers would be very much appreciated (and would stop me having to buy a new computer!)
Thanks in advance