Does not create table data
#2

Quote:
Originally Posted by Eripe
Посмотреть сообщение
Hello, I have a problem because I wanted to create tables 'bank' means I created it in phpmyadmin, I gave the appropriate values ​​INT, TEXT, uid, state, nickname% i,% i,% s, but unfortunately in phpmyadmin nothing adds, does not complete the table.

so create data for the player's table after registration


Код HTML:
	format(query, sizeof(query), "INSERT INTO ekwipunek (`slot1nazwa`, `slot1wartosc`,`nick`) VALUES ('%s', '%d',`%s`)",brak, 0, PlayerName(playerid));
	mysql_tquery(SQL_ID,query);

	
	format(query, sizeof(query), "INSERT INTO bank (`uid`, `stan`, `nick`) VALUES (`%i`,`%i`,`%s`)", pDane[playerid][UID],pDane[playerid][wBank],PlayerName(playerid));
	mysql_query(SQL_ID,query);
PHP код:
public OnGameModeInit()
{
    
//exemple to MySQL R41-4
    
SQL_ID mysql_connect(...); // connection to the database
    
new Cache:result mysql_query(SQL_ID,"CREATE TABLE IF NOT EXISTS `ekwipunek`(`slot1nazwa` varbinary(30) NOT NULL,`slot1wartosc` int(10) NOT NULL,`slot1nazwa`  varbinary(30) NOT NULL) ENGINE = InnoDB CHARACTER SET=utf8");
    
cache_delete(result);
    new 
Cache:result1 mysql_query(SQL_ID,"CREATE TABLE IF NOT EXISTS `bank`(`uid` int(10) NOT NULL,`stan` int(10) NOT NULL,`nick` varbinary(24) NOT NULL) ENGINE = InnoDB CHARACTER SET=utf8");
    
cache_delete(result1);
    return 
true;
}
    new 
query[200];
    
format(querysizeof(query), "INSERT INTO ekwipunek (`slot1nazwa`, `slot1wartosc`,`nick`) VALUES ('%e', '%d','%e')",brak0PlayerName(playerid)); //add %e is string escape
    
mysql_tquery(SQL_ID,query);
    new 
query[200];
    
format(querysizeof(query), "INSERT INTO bank (`uid`, `stan`, `nick`) VALUES ('%i','%i','%e')"pDane[playerid][UID],pDane[playerid][wBank],PlayerName(playerid));//add %e is string escape
    
mysql_query(SQL_ID,query); 
Reply


Messages In This Thread
Does not create table data - by Eripe - 08.04.2018, 08:13
Re: Does not create table data - by ForCop - 08.04.2018, 08:28
Re: Does not create table data - by Eripe - 08.04.2018, 08:56
Re: Does not create table data - by ForCop - 08.04.2018, 08:59
Re: Does not create table data - by Eripe - 08.04.2018, 09:20
Re: Does not create table data - by ForCop - 08.04.2018, 09:27
Re: Does not create table data - by Eripe - 09.04.2018, 14:12
Re: Does not create table data - by JesterlJoker - 09.04.2018, 15:15

Forum Jump:


Users browsing this thread: 2 Guest(s)