My SQL doesn't create a user
#1

Database connect succesful, but it doesn't create a user.

Why not?

Thanks,,

Код:
#include <a_samp>
#include <a_mysql>

#define SQL_HOST "localhost"
#define SQL_USER "USamp"
#define SQL_PASS "PSamp"
#define SQL_DB "MLSamp"

main()
{
}


public OnGameModeInit()
{
	SetGameModeText("Blank Script");
    if(!mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS))
    {
        print("SQL connection attempt 1 FAILED!");
        if(!mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS))
        {
            print("SQL connection attempt 2 FAILED!");
            if(!mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS))
            {
                print("SQL connection attempt 3 FAILED!");
                return 1;
            }
        }
    }else{
        print("SQL connection succes!");
		new PlayerName[50], password[50];
        new Query[200];
		format(PlayerName, 50, "Harry");
		format(password, 50, "MijnPassword");

        new escpname[50], escpass[50];
		mysql_real_escape_string(PlayerName, escpass);
        mysql_real_escape_string(password, escpname);
    	format(Query, sizeof(Query), "INSERT INTO `users` (`username`, `password`) VALUES ('%s', '%s')", escpname, escpass);
		mysql_query(Query);
		mysql_free_result();
		mysql_error();
	}
	
	return 1;
}

public OnGameModeExit()
{
	return 1;
}
Reply


Messages In This Thread
My SQL doesn't create a user - by Battleman - 29.01.2011, 19:15
Re: My SQL doesn't create a user - by Battleman - 30.01.2011, 10:59
Re: My SQL doesn't create a user - by armyoftwo - 30.01.2011, 11:09
Re: My SQL doesn't create a user - by Battleman - 30.01.2011, 11:35
Re: My SQL doesn't create a user - by Battleman - 30.01.2011, 13:22
Re: My SQL doesn't create a user - by woot - 30.01.2011, 13:37

Forum Jump:


Users browsing this thread: 1 Guest(s)