SA-MP Forums Archive
[Include] Easy MySQL - Simplifying the usage of MySQL queries! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Filterscripts (https://sampforum.blast.hk/forumdisplay.php?fid=17)
+---- Forum: Includes (https://sampforum.blast.hk/forumdisplay.php?fid=83)
+---- Thread: [Include] Easy MySQL - Simplifying the usage of MySQL queries! (/showthread.php?tid=606930)

Pages: 1 2 3 4


Re: Easy MySQL - Simplifying the usage of MySQL queries! - Max_Andolini - 06.09.2016

Quote:
Originally Posted by morris91
Посмотреть сообщение
Im trying to make it so on attachment edit, it adds the floats etc.. to the row that correctly corresponds to the Username & Slot.

Код:
public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
{
      new handle = SQL::OpenEx(SQL::UPDATE2, ""ATTACHMENTS"", "Username", pNick(playerid), "Slot", index);
Getting a argument 6 so guessing im missing something out.
Anyone can help? il be greatfull
public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
{
new handle = SQL::OpenEx(SQL::UPDATE2, ""ATTACHMENTS"", "Username", pNick(playerid), "Slot", index);

Change This

new handle = SQL::OpenEx(SQL::UPDATE2, "ATTACHMENTS", "Username", pNick(playerid), "Slot", index);


Re: Easy MySQL - Simplifying the usage of MySQL queries! - morris91 - 06.09.2016

Quote:
Originally Posted by eco1999
Посмотреть сообщение
public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ)
{
new handle = SQL::OpenEx(SQL::UPDATE2, ""ATTACHMENTS"", "Username", pNick(playerid), "Slot", index);

Change This

new handle = SQL::OpenEx(SQL::UPDATE2, "ATTACHMENTS", "Username", pNick(playerid), "Slot", index);
i Use
#define ATTACHMENTS "Attachments"

Just ease of mind, i did try just "Attachments" but still get the error.


Re: Easy MySQL - Simplifying the usage of MySQL queries! - Max_Andolini - 06.09.2016

Quote:
Originally Posted by morris91
Посмотреть сообщение
i Use
#define ATTACHMENTS "Attachments"

Just ease of mind, i did try just "Attachments" but still get the error.
Use this;

new handle = SQL::OpenEx(SQL::UPDATE2, ""ATTACHMENTS"", "Username", pNick(playerid), "Slot", "", index);


Re: Easy MySQL - Simplifying the usage of MySQL queries! - F1N4L - 06.09.2016

Quote:
Originally Posted by eco1999
Посмотреть сообщение
Use this;

new handle = SQL::OpenEx(SQL::UPDATE2, ""ATTACHMENTS"", "Username", pNick(playerid), "Slot", "", index);
Or

Код:
new handle = SQL::OpenEx(SQL::UPDATE2, ATTACHMENTS, "Username", pNick(playerid), "Slot", "", index);



Re: Easy MySQL - Simplifying the usage of MySQL queries! - morris91 - 06.09.2016

Quote:
Originally Posted by eco1999
Посмотреть сообщение
Use this;

new handle = SQL::OpenEx(SQL::UPDATE2, ""ATTACHMENTS"", "Username", pNick(playerid), "Slot", "", index);
That worked. thanks


Re: Easy MySQL - Simplifying the usage of MySQL queries! - Max_Andolini - 15.09.2016

3.3 version updated.


Re: Easy MySQL - Simplifying the usage of MySQL queries! - vernz - 07.11.2016

How do you delete a row from the db houses by example ?


Re: Easy MySQL - Simplifying the usage of MySQL queries! - GeneralAref - 19.12.2016

Is it possible to create 2 or 3 connections and work with them at the same time?


Re: Easy MySQL - Simplifying the usage of MySQL queries! - Max_Andolini - 19.12.2016

Quote:
Originally Posted by GeneralAref
Посмотреть сообщение
Is it possible to create 2 or 3 connections and work with them at the same time?
Maybe later.


Re: Easy MySQL - Simplifying the usage of MySQL queries! - Zoie - 04.04.2017

I don't know how to fix the string in the MySQL database with SQL:: WriteString write a garbled code, can you give me an example?


Re: Easy MySQL - Simplifying the usage of MySQL queries! - Max_Andolini - 24.11.2017

Updated version 3.4

- Bug fix.

Compatible MySQL version R41-4.


Re: Easy MySQL - Simplifying the usage of MySQL queries! - RowdyrideR - 10.01.2018

Error

Код:
invalid function or declaration
??


Re: Easy MySQL - Simplifying the usage of MySQL queries! - Max_Andolini - 10.01.2018

Quote:
Originally Posted by RowdyrideR
Посмотреть сообщение
Error

Код:
invalid function or declaration
??
Line?


Re: Easy MySQL - Simplifying the usage of MySQL queries! - RowdyrideR - 11.01.2018

Almost every line in that registration example


Re: Easy MySQL - Simplifying the usage of MySQL queries! - ThePhenix - 11.01.2018

Try downloading the latest version.


Re: Easy MySQL - Simplifying the usage of MySQL queries! - RowdyrideR - 11.01.2018

R41-4 Plugin

Код:
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(7) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(21) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(25) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(28) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(30) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(36) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(38) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(40) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(42) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(45) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(47) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(52) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(58) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(63) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(66) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(69) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(71) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(73) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(76) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(78) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(80) : error 075: input line too long (after substitutions)
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(85) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(88) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(90) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(92) : error 010: invalid function or declaration
C:\Games\GTA San Andreas\Server\HTB\V3\pawno\include\easy-mysql.inc(95) : error 010: invalid function or declaration



Re: Easy MySQL - Simplifying the usage of MySQL queries! - ThePhenix - 11.01.2018

Are you sure you're using the latest version? I mean the errors don't really make sense at all.

Code: https://github.com/ThreeKingz/easy-m...easy-mysql.inc

I don't get any errors when compiling, what code are you using, post it here...


Re: Easy MySQL - Simplifying the usage of MySQL queries! - RowdyrideR - 11.01.2018

im sorry it was a problem with the include itself, i was on my way to remove my comment

Thanks..


Re: Easy MySQL - Simplifying the usage of MySQL queries! - JR_Junior - 13.05.2018

The following code is not working:
PHP код:
    new string[128], names[24],money;
    new 
handle SQL::OpenEx(SQL::MREAD"Accounts""Money""""""", -110, -1"Money");
    
SQL::ReadRetrievedRows(handlei)
    {
        
SQL::ReadString(handle"AccountName"names24i);
        
SQL::ReadInt(handle"Money"moneyi);
        
format(stringsizeof(string), "Name %s | Money: %d"names,money);
        
SendClientMessage(playerid, -1string);
    }
    
SQL::Close(handle); 
Accounts in DB: 7

In the Mysql log:
PHP код:
[13:42:36] [DEBUGmysql_query(1"SELECT * FROM `Accounts` WHERE `Money`='' ORDER BY `Money` DESC LIMIT 10 "1)
[
13:42:36] [DEBUGCHandle::Execute(this=0x4f8c170type=3query=0x6705fd0)
[
13:42:36] [DEBUGCConnection::Execute(query=0x6705fd0this=0x674f80connection=0x4fa5968)
[
13:42:36] [DEBUGCQuery::Execute(this=0x6705fd0connection=0x4fa5968)
[
13:42:36] [INFOquery "SELECT * FROM `Accounts` WHERE `Money`='' ORDER BY `Money` DESC LIMIT 10 " successfully executed within 0.616 milliseconds
[13:42:36] [DEBUGCResultSet::Create(connection=0x4fa5968query_str='SELECT * FROM `Accounts` WHERE `Money`='' ORDER BY `Money` DESC LIMIT 10 ')
[
13:42:36] [DEBUGcreated new resultset '0x6710788'
[13:42:36] [DEBUGfetched MySQL result '0x66f8990'
[13:42:36] [DEBUGallocated 0 bytes for PAWN result
[13:42:36] [DEBUGCHandle::Execute - return valuetrue
[13:42:36] [DEBUGmysql_query: return value'1'
[13:42:36] [DEBUGcache_is_valid(1)
[
13:42:36] [DEBUGcache_is_valid: return value'true'
[13:42:36] [DEBUGcache_get_row_count(0x05FFF1E0)
[
13:42:36] [DEBUGcache_get_row_count: return value'1'
[13:42:36] [DEBUGcache_get_row_count(0x05FFF1D8)
[
13:42:36] [DEBUGcache_get_row_count: return value'1'
[13:42:36] [DEBUGcache_is_valid(1)
[
13:42:36] [DEBUGcache_is_valid: return value'true'
[13:42:36] [DEBUGcache_delete(1)
[
13:42:36] [DEBUGcache_delete: return value'1' 
Tried too: new handle = SQL::Open(SQL::MREAD, "Accounts", "Money", -1, "", -1, "", -1, -1, "Money");

But no data in chat!


Re: Easy MySQL - Simplifying the usage of MySQL queries! - Private200 - 13.05.2018

Even if old, I believe my MySQL include is easier to be understood and used: https://sampforum.blast.hk/showthread.php?tid=609990