Welcome Guest, Not a member yet? Register   Sign In
Database error, pulling my hair out now...

Hi there. I'm developing a new app with CodeIgniter (not my first one either), and am having some weird issues with my database.

I've var_dump'd my query and result, and here's what I see:

object(CI_DB_mysql_result)#20 (7) {
  resource(31) of type (mysql link persistent)
  resource(49) of type (mysql result)
  array(0) {
  array(0) {
array(0) {

A PHP Error was encountered

Severity: Notice

Message: Trying to get property of non-object

Filename: models/tsheets_model.php

Line Number: 51
A Database Error Occurred

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 '' at line 1

UPDATE `users` SET `uses_tsheets` = '1' WHERE `user_id` =

Here's the relevant code:

$query = $this->db->get_where('users', array('user_id' => $id), '1');
$result = $query->row();

I'm 100% positive my database is set up correctly in config, and there aren't any typos in my code (I've even copy/pasted from a WORKING database driven app, and still get the errors).

the error showing the result that you have an error at your update query so paste your model here

Ugh...Forgive me...It's amazing how arrogant you get at 2 am. >.<

I was trying to get session data using
instead of

The session data wasn't loaded in flash data...>.>

Sorry to bother everyone.

That's ok, we all have goof ups like this at times. Smile

Theme © iAndrew 2016 - Forum software by © MyBB