Skip to content

Call to a member function fetch_field() on a non-object #44

@makhmudoff

Description

@makhmudoff

Hi im using yours class. And im trying insert data to mysql base. if exists this row then need update. for this i used INSERT ... ON DUPLICATE KEY UPDATE... My code like this.
$db->rawQuery("INSERT INTO table1 (field1,field2,field3) VALUES (?,?,?) ON DUPLICATE KEY UPDATE field2=VALUES(field2),field3=VALUES(field3)", array("value1",value2,value2));
This code works file but when im trying put values from another array. My code like this: $db->rawQuery("INSERT INTO table1 (field1,field2,field3) VALUES (?,?,?) ON DUPLICATE KEY UPDATE field2=VALUES(field2),field3=VALUES(field3)", array($value[$i]['value1'],$value[$i]['value2'],$value[$i]['value3']));
it shows me this error:
Fatal error: Call to a member function fetch_field() on a non-object in /project/classes/mysqlidb.class.php on line 427
how i can solve this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions