ok please help, my head is about to explode. Outside codeigniter this works but for some reason it doesn’t inside the codeigniter framework. i’m in the process of transfering my site to using codeigniters framework. anyway the problem:
In my index page I am trying to show for lesson boxes by called a function called showLesson($lessonNo);
e.g.
$query = $this->db->query(“SELECT lessonNo FROM lesson ORDER BY dateTime DESC LIMIT 4”);
foreach($query->result_array() as $row){
showLesson(10);
}
In showLesson I have a query to get lesson details and display them e.g.
$lessonDetails = mysql_fetch_assoc(mysql_query(“SELECT * FROM lesson WHERE lessonNo=’$lessonNo’”));
$name = $lessonDetails[“name”];
$difficulty = $lessonDetails[“difficulty”];
$details = $lessonDetails[“details”];
For some reason only the first lesson is shown on the index page and not the other 3. I get the following error
Message: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource
referring to $lessonDetails above in showLesson. Now this works outside codeigniter no problem, why is codeigniter being difficult!!
thanks
