[Include] Easy MySQL - Simplifying the usage of MySQL queries!
#21

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);
Reply
#22

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.
Reply
#23

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);
Reply
#24

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);
Reply
#25

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

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

3.3 version updated.
Reply
#27

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

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

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

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?
Reply
#31

Updated version 3.4

- Bug fix.

Compatible MySQL version R41-4.
Reply
#32

Error

Код:
invalid function or declaration
??
Reply
#33

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

Код:
invalid function or declaration
??
Line?
Reply
#34

Almost every line in that registration example
Reply
#35

Try downloading the latest version.
Reply
#36

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
Reply
#37

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...
Reply
#38

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

Thanks..
Reply
#39

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!
Reply
#40

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


Forum Jump:


Users browsing this thread: 1 Guest(s)