Welcome Guest, Not a member yet? Register   Sign In
Bug? in Database Library
#1

[eluser]ifew[/eluser]
first i use
Code:
$this->db->where('id', $id);
$this->db->where('metaname', $type);
$query = $this->db->get('tag');
and run. it show "could not connection" in page and other.
if i delete last record in tag table. it ok!?!?!

and now i use standard code with
Code:
$query = $this->db->query("SELECT * FROM tag WHERE id='".$id."' AND metaname='".$type."'");
$row = $query->row();
it's ok.

i use
codeigniter 1.6.2 (library url,input,validation,database)
windows xp pro sp2
apache 2.2.4
mysql 5.0.18
php 5.2.3
#2

[eluser]Derek Allard[/eluser]
if you use $this->db->last_query() what SQL does the first example write for you?
#3

[eluser]ifew[/eluser]
i use $this->db->last_query()
it show correct sql command

SELECT * FROM tag WHERE id='4' AND metaname='category'

but not run if use Active Record Class
#4

[eluser]Derek Allard[/eluser]
Well, that is confusing indeed, I can see where you're confused. That obviously doesn't make any sense. If you have time to investigate further I'm sure we'd all like to know more. I'm not able to reproduce this, and I've never heard any reports of this either.
#5

[eluser]ifew[/eluser]
i tested in my server (DA, apache 1.3, php 5.2, mysql5)
it show error

Fatal error: Allowed memory size of 20971520 bytes exhausted (tried to allocate 41 bytes) in /public_html/system/database/drivers/mysql/mysql_result.php on line 168

sql command in controller
Code:
$this->db->from('tag');
$this->db->where('metaname', "category");
$this->db->order_by("id", "desc");
$query = $this->db->get();
$template['list_category'] = $query->result();

database
Code:
CREATE TABLE `tag` (
  `id` tinyint(5) NOT NULL auto_increment,
  `parent_id` tinyint(5) default NULL,
  `language` varchar(15) collate utf8_unicode_ci default NULL,
  `metaname` varchar(20) collate utf8_unicode_ci default NULL,
  `name` varchar(100) collate utf8_unicode_ci default NULL,
  `slug` varchar(100) collate utf8_unicode_ci default NULL,
  `description` varchar(255) collate utf8_unicode_ci default NULL,
  `keyword` varchar(255) collate utf8_unicode_ci default NULL,
  `counter` int(10) default '0',
  `image` varchar(110) collate utf8_unicode_ci default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
#6

[eluser]Derek Allard[/eluser]
A running out of memory error is much different then what you described earlier. Try simplifying your controller down until you figure out the culprit here.




Theme © iAndrew 2016 - Forum software by © MyBB