⚠ In case you've missed it we are migrating 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 forum is read-only and soon will be archived. ⚠

SELECT `table`. FROM `table`


  • Please log in to reply
1 reply to this topic

#1 manusimpson



  • Members
  • Pip
  • 1 posts

Posted 31 May 2018 - 04:43 PM

Hi guys, I'm new in Grocery world so I hope do not ask a silly question.

I did one function in my controller that works great even with multiple table relation, but now I did another function with a very very simple crud and I'm getting this error, like that the query is being created without selecting fields o *.


This is my code:

public function historico()
		$crud = new grocery_CRUD();
		$output = $crud->render();
		$output->css_files[] = base_url() . 'assets/bootstrap/css/bootstrap.min.css';
		$output->js_files[] = base_url() . 'assets/bootstrap/js/bootstrap.min.js';
		$this->load->view('historico', $output);

and response:


Error Number: 1064

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 'FROM `historico`' at line 2

SELECT `historico`. FROM `historico`

Filename: [***]/system/database/DB_driver.php

Line Number: 691


Thanks for reply.




#2 JavaBean



  • Members
  • Pip
  • 1 posts

Posted 14 June 2018 - 08:53 AM

Hi Manuel

I've just had the same problem.

You are missing a PRIMARY INDEX on your 'historico' table.



Also tagged with one or more of these keywords: SQL

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users