Browse Source

Reserved keyword conflict in MySQL.

develop
Raphael Jackstadt 10 years ago
parent
commit
a11bdbe580
  1. 6
      application/libraries/Aauth.php
  2. 4
      sql/Aauth_v2.sql

6
application/libraries/Aauth.php

@ -1714,7 +1714,7 @@ class Aauth {
'receiver_id' => $receiver_id, 'receiver_id' => $receiver_id,
'title' => $title, 'title' => $title,
'message' => $message, 'message' => $message,
'date' => date('Y-m-d H:i:s') 'date_sent' => date('Y-m-d H:i:s')
); );
return $query = $this->aauth_db->insert( $this->config_vars['pms'], $data ); return $query = $this->aauth_db->insert( $this->config_vars['pms'], $data );
@ -1796,7 +1796,7 @@ class Aauth {
} }
$query = $this->aauth_db->where('receiver_id', $receiver_id); $query = $this->aauth_db->where('receiver_id', $receiver_id);
$query = $this->aauth_db->where('read', 0); $query = $this->aauth_db->where('date_read', NULL);
$query = $this->aauth_db->get( $this->config_vars['pms'] ); $query = $this->aauth_db->get( $this->config_vars['pms'] );
return $query->num_rows(); return $query->num_rows();
@ -1811,7 +1811,7 @@ class Aauth {
public function set_as_read_pm($pm_id){ public function set_as_read_pm($pm_id){
$data = array( $data = array(
'read' => 1, 'date_read' => date('Y-m-d H:i:s')
); );
$this->aauth_db->update( $this->config_vars['pms'], $data, "id = $pm_id"); $this->aauth_db->update( $this->config_vars['pms'], $data, "id = $pm_id");

4
sql/Aauth_v2.sql

@ -75,8 +75,8 @@ CREATE TABLE `aauth_pms` (
`receiver_id` int(11) unsigned NOT NULL, `receiver_id` int(11) unsigned NOT NULL,
`title` varchar(255) NOT NULL, `title` varchar(255) NOT NULL,
`message` text, `message` text,
`date` datetime DEFAULT NULL, `date_sent` datetime DEFAULT NULL,
`read` tinyint(1) DEFAULT '0', `date_read` datetime DEFAULT NULL,
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `full_index` (`id`,`sender_id`,`receiver_id`,`read`) KEY `full_index` (`id`,`sender_id`,`receiver_id`,`read`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Loading…
Cancel
Save