Welcome Guest, Not a member yet? Register   Sign In
Fatal error: Call to a member function row() on a non-object
#1

[eluser]BrandonDurham[/eluser]
Why would this be happening here?
Code:
$sql = "UPDATE prizes SET
    email                 = '$email',
    fname                = '$first_name',
    lname                = '$last_name',
    address1            = '$address',
    address2             = '$add_address',
    city                 = '$city',
    state                 = '$state',
    zip                  = '$zip',
    date_submitted      = '$date_submitted',
    opt_in                 = '$opt_in',
    company             = '$company',
    day_phone            = '$day_phone',
    evening_phone        = '$evening_phone'
    WHERE id            = '8'
";

$query = $this->db->query($sql);
$row = $query->row();
Here's the full error:
Quote:Fatal error: Call to a member function row() on a non-object in /Users/Deefee/Documents/Sites/073MHG232/system/application/models/db_functions.php on line 88
Line 88 is $row = $query->row();.
#2

[eluser]BrandonDurham[/eluser]
Here's the query it's spitting out:
Code:
UPDATE prizes SET email = '[email protected]', fname = 'Brandon', lname = 'Durham', address1 = '5300 Bee Caves Road', address2 = '17305 E Darleen', city = 'Austin', state = 'AK', zip = '78745', date_submitted = '2007-08-25 18:35:26', opt_in = 'Yes', company = 'Kolar Advertising', day_phone = '(123) 123-1231', evening_phone = '(555) 555-5555' WHERE id = '8'
#3

[eluser]NemetraL[/eluser]
Any issue with your SQL code?

Try a var_dump() on the $query variable..
#4

[eluser]glemigh[/eluser]
Can you issue a similar MySQL statment in phpMyAdmin or like tool?


George
#5

[eluser]BrandonDurham[/eluser]
It works fine if I use that same query directly in PHPMyAdmin's SQL window.
#6

[eluser]Michael Wales[/eluser]
Is the database library being included? I would assume so, since db->query didn't issue the error.
#7

[eluser]NemetraL[/eluser]
Post the var_dump() so that we can see what's inside.. ;-)
#8

[eluser]BrandonDurham[/eluser]
I'm an idiot.

That query used to be an insert and is now an update. That's why it's not returning any rows.

Sorry for not catching that sooner. Thanks for the help.
#9

[eluser]glemigh[/eluser]
I thought of that this morning, apparently sleep helps, glad you were able to discover the problem.

George




Theme © iAndrew 2016 - Forum software by © MyBB