Welcome Guest, Not a member yet? Register   Sign In
Bug: $this->db->count_all('my_table'); and CI_VERSION
#1

[eluser]John_Betong[/eluser]
 
CodeIgniter User Guide Version 1.6.0
 
Active Record Class

Quote: $this->db->count_all();
Permits you to determine the number of rows in a particular table.
Submit the table name in the first parameter.
Example:
Code:
echo $this->db->count_all('my_table');
// Produces an integer, like 25

 
Actual Results
Quote:The Error returned was:
An Error Was Encountered

Error Number: 1064

You have an error in your SQL syntax;
check the manual that corresponds to your MySQL server version
for the right syntax to use near 'FROM `quotes`' at line 1

SELECT COUNT(*) AS FROM `quotes`
 

Possible solution/kludge

file: system/data/base/drives/mysql/mysql_driver.php
Quote: // revised line: 45
var $_count_string = 'SELECT COUNT(*) AS numrows ';

// Old line 45
// var $_count_string = 'SELECT COUNT(*) AS ';

 
 
Three guesses but no prizes for the result of this code

Code:
echo CI_VERSION;

 

Cheers,

John_Betong
#2

[eluser]Derek Allard[/eluser]
These were both addressed in the svn.




Theme © iAndrew 2016 - Forum software by © MyBB