SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 13/06/2019, 06:52 AM   #1
dongtuuyenblackpeony
Little Clucker
 
Join Date: Jun 2019
Posts: 1
Reputation: 0
Default Problem with database

Hello everyone, I need help!


By adding this table to the database [/B]

CREATE TABLE `suspended` (
`id` int(11) NOT NULL,
`user` int(11) NOT NULL,
`suspendedby` int(11) NOT NULL,
`stime` varchar(34) NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`reason` varchar(34) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `suspended`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
ALTER TABLE `suspended`
ADD PRIMARY KEY (`id`);

The Data Base returns this error to me

1075 - There can only be one auto field in the table and it must be defined as a key
dongtuuyenblackpeony is offline   Reply With Quote
Old 13/06/2019, 07:55 AM   #2
SiaReyes
Big Clucker
 
SiaReyes's Avatar
 
Join Date: Mar 2019
Location: Coordinates X,Y,Z
Posts: 127
Reputation: 8
Default Re: Problem with database

Code:
CREATE TABLE `suspended` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user` int(11) NOT NULL,
`suspendedby` int(11) NOT NULL,
`stime` varchar(34) NOT NULL,
`time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`reason` varchar(34) NOT NULL DEFAULT 'NoData',
 PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
Here
__________________
Join Modern Freeroam Discord https://discord.gg/2BNWCG
MF still hiring new staff contact Code#9776

BETTERWATCH
OUT!


Hostname: .::MF::. Freeroam/MiniGames/CS/CnR/GunGame/Race/APEX
IP/Port: 51.68.208.5:7777
SiaReyes is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with database prototype0104 Server Support 3 20/02/2017 06:21 PM
database problem. SpikeSpigel Scripting Help 10 28/07/2015 02:20 AM
Database Problem gotwarzone Server Support 1 10/03/2014 11:42 PM
database problem Fernado Samuel Scripting Help 13 10/05/2013 01:18 PM
car problem add in database Hellman92 Scripting Help 5 04/11/2011 03:05 AM


All times are GMT. The time now is 05:49 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.