asked on
public function get_verses($chapter)
{
$this->db->select('*');
$this->db->from('isaiah');
$this->db->where('chapter', $chapter);
$query = $this->db->get();
if($query->num_rows() == 0) return false;
return $query->result_array();
}
$chapters = $this->book_model->get_chapters();
foreach ($chapters as $chapter) {
$this->book_model->get_verses($chapter['chapter']);
}
ASKER
public function get_verses($chapter)
ASKER
function homepage()
{
$chapters = $this->book_model->get_chapters();
foreach ($chapters as $chapter) {
$verses= $this->book_model->get_verses($chapter['chapter']);
echo $chapter['chapter']."<br>";
foreach ($verses as $verse) {
echo $verse['verseName']."<br>";
echo $verse['text']."<br>";
echo "<br>";
}
}
$this->load->view('book/homepage', $data);
}
ASKER
$data = new array();
$data['firstname'] = "chris";
echo $data['firstname'];
$data = new stdClass();
$data->firstname = "chris";
echo $data->firstname;
// Query the database and instantiate a User for each record
foreach ($query->result('User') as $row)
{
// output a column name
echo $row->firstname;
// call a method
echo $row->getFullName();
}
ASKER
PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.
TRUSTED BY
ASKER