⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Error Number: 42000



mhdghavam
  • profile picture
  • Member

Posted 22 June 2016 - 13:08 PM

Hi, I installed GroceryCRUD and when I rum my program give this error 

 

 

Error Number: 42000

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

SELECT TOP 1 FROM sj_news_sanjeh

Filename: C:\xampp\htdocs\ci\system\database\DB_driver.php

Line Number: 331

 

and I use PDO for Database connect

 

this is my config in config/database.php

 

$active_group = 'default';

$active_record = TRUE;
 
$db['default']['hostname'] = 'mysql:host=localhost;dbname=news;';
$db['default']['username'] = 'root';
$db['default']['password'] = '';
$db['default']['database'] = 'news';
$db['default']['dbdriver'] = 'pdo';
$db['default']['dbprefix'] = 'sj_';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
 
 
 
 
and this is my Controller:
 
 
 
public function employees_example()
{
$this->load->library('grocery_CRUD'); 
$crud = new grocery_CRUD();
 
$crud->set_table('sj_news_sanjeh');
$output = $crud->render();
echo 'ok'; 
$this->_example_output($output);  
             
}