• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Database error, pulling my hair out now...

#1
[eluser]Militis[/eluser]
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:

Code:
object(CI_DB_mysql_result)#20 (7) {
  ["conn_id"]=>
  resource(31) of type (mysql link persistent)
  ["result_id"]=>
  resource(49) of type (mysql result)
  ["result_array"]=>
  array(0) {
  }
  ["result_object"]=>
  array(0) {
  }
  ["current_row"]=>
  int(0)
  ["num_rows"]=>
  int(0)
  ["row_data"]=>
  NULL
}
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:

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

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).


Messages In This Thread
Database error, pulling my hair out now... - by El Forum - 10-13-2009, 01:07 AM
Database error, pulling my hair out now... - by El Forum - 10-13-2009, 01:11 AM
Database error, pulling my hair out now... - by El Forum - 10-13-2009, 01:15 AM
Database error, pulling my hair out now... - by El Forum - 10-14-2009, 01:36 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.