Welcome Guest, Not a member yet? Register   Sign In
use of Unique in mySQL field cases Error
#12

I am getting this error:

ERROR - 2020-07-25 16:34:30 --> Severity: error --> Exception: syntax error, unexpected 'protected' (T_PROTECTED), expecting end of file /app/application/models/MyModel.php 16

I also tried public and I get this:

ERROR - 2020-07-25 16:36:27 --> Severity: error --> Exception: syntax error, unexpected 'public' (T_PUBLIC), expecting end of file /app/application/models/MyModel.php 16

Here is MyModel.php from models
````
<?php
/**
* Created by PhpStorm.
* User: richb201
* Date: 12/16/2017
* Time: 3:57 PM
*/
// Add this to your model.

/**
* Prepare INSERT IGNORE SQL query
*
* @param Array $data Array in form of "Column" => "Value", ...
* @return Null
*/
public function insertIgnore(array $data)
{
    $_prepared = array();

    foreach ($data as $col => $val)
    {
        $_prepared[$this->db->_escape_identifiers($col)] = $this->db->escape($val);
    }

    $this->db->query('INSERT IGNORE INTO `titles` ('.implode(',',array_keys($_prepared)).') VALUES('.implode(',',array_values($_prepared)).');');
}
?>

````
proof that an old dog can learn new tricks
Reply


Messages In This Thread
RE: use of Unique in mySQL field cases Error - by richb201 - 07-25-2020, 09:44 AM



Theme © iAndrew 2016 - Forum software by © MyBB