• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.