MySQl tables are not created
#1

I was following one MySQL script by Konstantinos. I am begginer in MySQL xD so..
There is SetupPlayerTable()
PHP код:
SetupPlayerTable()
{
    
mysql_tquery(g_SQL"CREATE TABLE IF NOT EXISTS `players` (`id` int(11) NOT NULL AUTO_INCREMENT,`username` varchar(24) NOT NULL,`password` char(64) NOT NULL,`salt` char(16) NOT NULL,`kills` mediumint(8) NOT NULL DEFAULT '0',`deaths` mediumint(8) NOT NULL DEFAULT '0',`x` float NOT NULL DEFAULT '0',`y` float NOT NULL DEFAULT '0',`z` float NOT NULL DEFAULT '0',`angle` float NOT NULL DEFAULT '0',`interior` tinyint(3) NOT NULL DEFAULT '0', PRIMARY KEY (`id`), UNIQUE KEY `username` (`username`))");
    return 
1;

Problem is that it only creates 1 table named Players.. Any ideas?
Reply
#2

What else is it supposed to create then? I fail to see the problem.

Also creating tables from within the script isn't such a good idea, in my opinion. Table creation ideally happens only once in the entire lifetime of the server so it seems silly to hardcode it in the script. Save the table creation script in a .sql file and use it when necessary.
Reply
#3

So what do you suggest?? Should i create them manually and remove that SetupPlayerTable func?
Reply
#4

No no.. HOld on!! Tables are created!! Lol xD
Problem is that it won't save player once he registers..
Reply
#5

For anyone reading the comments, it's something I also suggest to do: https://github.com/pBlueG/SA-MP-MySQ...he.pwn#L80-L81

Anyway, download the latest commit from here: https://ci.appveyor.com/api/buildjob...-R41-win32.zip

Re-compile, start the server and join to register a new account. Disconnect and post what is written in logs/plugins/mysql.txt file.
Reply
#6

These logs i got
Код:
[21:09:01] [WARNING] mysql_connect: no password specified (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:60)
[21:09:45] [ERROR] °Љt (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:187)
[21:09:45] [ERROR] ёKv (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:187)
[21:09:45] [ERROR] ѕt (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:187)
[21:09:45] [ERROR] ёKv (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:187)
[21:09:45] [ERROR] ёKv (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:187)
[21:09:45] [ERROR] ёKv (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:187)
[21:09:45] [ERROR] ёKv (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:187)
[21:09:45] [ERROR] &t (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:187)
[21:09:45] [ERROR] °Lv (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:187)
[21:09:45] [ERROR] &t (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:187)
[21:09:45] [ERROR] &t (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:187)
[21:09:45] [ERROR] &t (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:187)
[21:09:45] [ERROR] &t (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:187)
[21:09:45] [ERROR] &t (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:187)
[21:09:45] [ERROR] ђЧt (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:187)
[21:09:45] [ERROR] &t (C:\Users\Micko\Desktop\MySQL\gamemodes\Untitled.pwn:187)
I also have latest MySQL version
Reply
#7

There was a bug in R41 with corrupted error logging and was fixed after reported. Replace with the latest commit I have linked above so we can get the errors.
Reply
#8

Konstantinos look at this

https://sampforum.blast.hk/showthread.php?tid=620228
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)