Welcome Guest, Not a member yet? Register   Sign In
db->truncate produces error
#1

[eluser]MaDe[/eluser]
Using $this->db->truncate('table') will report the following error in your logfile:

Quote:ERROR - 2008-11-12 15:16:40 --> Severity: Warning --> mysql_num_rows(): supplied argument is not a valid MySQL result resource path\to\CI\system\database\drivers\mysql\mysql_result.php 37

Using CI 1.7.0.

Bug?

Regards,
MaDe
#2

[eluser]Unknown[/eluser]
change code:

/database/DB_driver.php->is_write_type() // cca line 620
old:
Code:
if ( ! preg_match('/^\s*"?(SET|INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|LOAD DATA|COPY|ALTER|GRANT|REVOKE|LOCK|UNLOCK)\s+/i', $sql))

new:
Code:
if ( ! preg_match('/^\s*"?(SET|INSERT|UPDATE|DELETE|REPLACE|CREATE|DROP|LOAD DATA|COPY|ALTER|GRANT|REVOKE|LOCK|UNLOCK|TRUNCATE)\s+/i', $sql))




Theme © iAndrew 2016 - Forum software by © MyBB