Giter Site home page Giter Site logo

easy-mysql's People

Contributors

freddyb1 avatar maxandolini avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

easy-mysql's Issues

Error on compile

include\easy-mysql.inc(1116) : error 001: expected token: "-string end-", but found "-identifier-"
include\easy-mysql.inc(1169) : error 001: expected token: "-string end-", but found "-identifier-"

Line 1116 - handle = SQL::CreateTable(table, (isnull(column_where)) ? "InnoDB" : column_where, (isnull(column_where2)) ? "latin5" : column_where2, connectionHandle);

Line 1169 - handle = SQL::CreateTable(table, (isnull(column_where)) ? "InnoDB" : column_where, (isnull(column_where2)) ? "latin5" : column_where2, connectionHandle);

Allow to select log types

Hello, I'm newbie and I do not know much how to use the Git Hub, but I wanted to suggest an improvement.

I suggest we can select the log type on the connection:

stock MySQL:SQL::Connect(const host[], const user[], const password[], const database[], debugging = 0, port = 3306, bool:autoreconnect = true, pool_size = 2)
{
	switch(debugging)
	{
		case 0: mysql_log(NONE);
		case 1: mysql_log(ALL);
		case 2: mysql_log(ERROR);
		case 3: mysql_log(WARNING);
		case 4: mysql_log(INFO);
		case 5: mysql_log(DEBUG);
		case 6: mysql_log(ERROR | WARNING);
		case 7: mysql_log(ERROR | DEBUG);
		case 8: mysql_log(ERROR | INFO);
		case 9: mysql_log(WARNING | DEBUG);
		case 10: mysql_log(WARNING | INFO);
		case 11: mysql_log(INFO | DEBUG);
		case 12: mysql_log(ERROR | WARNING | DEBUG);
		case 13: mysql_log(ERROR | WARNING | DEBUG | INFO);
		case 14: mysql_log(WARNING | DEBUG | INFO);
	}
	new MySQLOpt:options = mysql_init_options();
	mysql_set_option(options, SERVER_PORT, port);
	mysql_set_option(options, AUTO_RECONNECT, autoreconnect);
	mysql_set_option(options, POOL_SIZE, pool_size);
	new MySQL:SQL::mc = mysql_connect(host, user, password, database, options);
	if(mysql_errno(SQL::mc) != 0)
	{
		SQL_Warning("Could not connect to database %s on host %s | user %s and password %s", database, host, user, password);

	}
	else
	{
	    SQL_Notice("Successfully connected to database!");
	}
	return SQL::mc;
}

How to change table

Hello, how to add new columns to the table after it's already been created by the first one?

table already created
if(!SQL::ExistsTable(SQL_PLAYERS_TABLE))
{
//If not, then create a table called 'players'.
new handle = SQL::Open(SQL::CREATE, SQL_PLAYERS_TABLE); //Opening a valid handle to create a table called 'players'
SQL::AddTableColumn(handle, "p_id", SQL_TYPE_INT, 11, true); //Setting auto-increment for this field.
SQL::AddTableColumn(handle, "p_name", SQL_TYPE_VCHAR, 24);
SQL::AddTableColumn(handle, "p_password", SQL_TYPE_VCHAR, 64);
SQL::AddTableColumn(handle, "p_score", SQL_TYPE_INT);
SQL::AddTableColumn(handle, "p_posx", SQL_TYPE_FLOAT);
SQL::AddTableColumn(handle, "p_posy", SQL_TYPE_FLOAT);
SQL::AddTableColumn(handle, "p_posz", SQL_TYPE_FLOAT);
SQL::Close(handle);//Closing the previous opened handle.
}

new field that needs to be added
SQL::AddTableColumn(handle, "health", SQL_TYPE_FLOAT);

UpdateVar using this include

Hello. I want to make something like this with this include:

function UpdateVar( playerid, varname[ ], varnameingame ) {
if(playerid == INVALID_PLAYER_ID) return 1;
gString[ 0 ] = (EOS);
mysql_format( SQL, gString, sizeof gString, "UPDATE users SET %s = '%d' WHERE ID = '%d'", varname, varnameingame, PlayerInfo[ playerid ][ pSQLID ] );
mysql_tquery( SQL, gString, "", "" );
return 1;
}

Is possible? And how? I tried already to make it, but no result.

Top 10 ranking with hand money+bank money

Hello. Is it possible to rank with the hand and bank money, adding the two?

new string[128], names[24],money;
new handle = SQL::OpenEx(SQL::MREAD, "Accounts", "", "", "", "", -1, 10, -1, "Money");
SQL::ReadRetrievedRows(handle, i)
{
SQL::ReadString(handle, "AccountName", names, 24, i);
SQL::ReadInt(handle, "Money", money, i);
format(string, sizeof(string), "Name %s | Money: %d", names,money);
SendClientMessage(playerid, -1, string);
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.