Welcome Guest, Not a member yet? Register   Sign In
query builder
#1

```php
  $rs = $this->db->query("SELECT *
FROM `curriculum_subjects`
WHERE (`curriculum_id` = 20
AND `curriculum_subject_semester` = 'first'
AND `curriculum_subject_year_level` = 1)")->result();

print_r($rs);

has a result

but really has no data, while in PHPmyadmin has no result


```
Reply
#2

(This post was last modified: 05-20-2017, 12:52 AM by Rufnex.)

You have to query the selected result e.g. with "$rs->result()" ...

https://www.codeigniter.com/userguide3/d...sults.html

Edit: havent seen the use of result in your query ^^ .. sorry .. PaulD is right.

Reply
#3

Try:
PHP Code:
$rs $this->db->from('curriculum_subjects')
 ->
where('curriculum_id'20)
 ->
where('curriculum_subject_semester''first')
 ->
where('curriculum_subject_year_level'1)
 ->
get()
 ->
result_array(); 
Reply




Theme © iAndrew 2016 - Forum software by © MyBB