SQL syntax error

dotaachen

B1G-Software-Kunde
#1
Hallo,

ich habe ein Problem mit einem Plugin, dass ich im moment schreibe.

Folgende Datenbank habe ich:
PHP:
CREATE TABLE `{pre}plugin_abc_groups` (
			`id` int(11) NOT NULL AUTO_INCREMENT,
			`group` int(11) NOT NULL,
			`time` int(11) NOT NULL,
			PRIMARY KEY (`id`)) ENGINE=MyISAM AUTO_INCREMENT=1 ;
Danach rufe ich folgenden Befehl auf
PHP:
$res2 = $db->Query('SELECT time FROM {pre}plugin_abc_groups WHERE group=?',
				(int) $row['id']);
			if($res2->RowCount() == 0)
			{
}
Dieser Fehler tritt dabei auf:
PHP:
Fatal error: Call to a member function RowCount() on a non-object in abc.php on line 187
Muss ich group noch als PRIMARY KEY hinzufügen oder irgendwas an der Datenbank ändern?
Ich würde mich über Hilfe freuen.

Gruß
Peter
 

dotaachen

B1G-Software-Kunde
#3
Logs:
PHP:
(db.class.php:157) MySQL-Error at '/mail/admin/plugin.page.php': '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 'group='1'' at line 1', tried to execute 'SELECT time F
 
Top