Welcome Guest, Not a member yet? Register   Sign In
Where trouble
#1

[eluser]sherwoodforest[/eluser]
I am having trouble finding a bug in my code
I want to get all the records is the sms_interpreted database
I have echoed the $this->db->last_query

SELECT * FROM (`SMS_interpreted`) WHERE `lead_id` = 'L658327' ORDER BY `interpreted_id` desc LIMIT 500
followed by a count $this->db->count_all_results()

which give me 1

but when I paste the above query in php my admin I get 216 total rows but I only got 1 back in my code.

here is my code
function get_entries_lead($lead)
{
$this->db->order_by("interpreted_id","desc");
$this->db->where('lead_id',$lead);
$query = $this->db->get('SMS_interpreted',500);

echo('<br>'.$this->db->last_query());
echo('<br>'.$this->db->count_all_results());
var_dump($query);
return $query->result();
}
where should I look for my error or why am I only getting one result?
#2

[eluser]sherwoodforest[/eluser]
why is it that right after I post a problem I find my error


sherwood
#3

[eluser]jedd[/eluser]
[quote author="sherwoodforest" date="1248814762"]why is it that right after I post a problem I find my error


sherwood[/quote]

A more interesting question (or two) are:
o why do people not modify the subject to include a [ SOLVED ] prefix so others know not to come here,
o why do some people say 'I fixed it!' but then decline to say HOW .. this would be particularly frustrating for people searching the forums for insight,
o why the dearth of imagination when coming up with a subject (where trouble - is not particularly descriptive),
o why are people confused about [ code ] tags - they are insanely handy things, and very straightforward - it's just one mouse-button click.
#4

[eluser]sherwoodforest[/eluser]
it was one object being returned
the contents of the object had 216 records
#5

[eluser]kgill[/eluser]
Oh oh more questions!
- why do we compulsively check these forums day after day
- why am I not surprised by any of jedd's questions
- why is jedd an angry beaver today? Wink




Theme © iAndrew 2016 - Forum software by © MyBB